Commit 542cf045 authored by rockyl's avatar rockyl

修改tween,增加host

parent 1fcc68a6
...@@ -7,12 +7,14 @@ const commonjs = require('rollup-plugin-commonjs'); ...@@ -7,12 +7,14 @@ const commonjs = require('rollup-plugin-commonjs');
const typescript = require('rollup-plugin-typescript2'); const typescript = require('rollup-plugin-typescript2');
const {uglify} = require('rollup-plugin-uglify'); const {uglify} = require('rollup-plugin-uglify');
const name = 'scilla-components';
export default { export default {
input: 'src/index.ts', input: 'src/index.ts',
output: { output: {
file: 'dist/bundle.js', file: `dist/${name}.js`,
format: 'umd', format: 'umd',
name: 'scilla-components', name,
//sourcemap: true, //sourcemap: true,
}, },
plugins: [ plugins: [
...@@ -23,6 +25,7 @@ export default { ...@@ -23,6 +25,7 @@ export default {
typescript: require('typescript'), typescript: require('typescript'),
tslib: require('tslib'), tslib: require('tslib'),
useTsconfigDeclarationDir: true, useTsconfigDeclarationDir: true,
declaration: false,
}), }),
commonjs(), commonjs(),
//uglify({}), //uglify({}),
......
...@@ -11,7 +11,15 @@ import {getStageSize, ScillaComponent, } from "scilla"; ...@@ -11,7 +11,15 @@ import {getStageSize, ScillaComponent, } from "scilla";
export default class FullStageSize extends ScillaComponent { export default class FullStageSize extends ScillaComponent {
once: boolean = true; once: boolean = true;
private stageSize; private _stageSize;
get stageSize(){
if(!this._stageSize){
this._stageSize = getStageSize();
}
return this._stageSize;
}
onCreate() { onCreate() {
super.onCreate(); super.onCreate();
...@@ -20,8 +28,6 @@ export default class FullStageSize extends ScillaComponent { ...@@ -20,8 +28,6 @@ export default class FullStageSize extends ScillaComponent {
onAwake() { onAwake() {
super.onAwake(); super.onAwake();
this.stageSize = getStageSize();
this.execute(); this.execute();
} }
...@@ -33,6 +39,12 @@ export default class FullStageSize extends ScillaComponent { ...@@ -33,6 +39,12 @@ export default class FullStageSize extends ScillaComponent {
} }
} }
onEditorUpdate(t) {
super.onEditorUpdate(t);
this.execute();
}
execute() { execute() {
const {width, height} = this.stageSize; const {width, height} = this.stageSize;
......
...@@ -14,6 +14,7 @@ import Transform from './base/Transform'; ...@@ -14,6 +14,7 @@ import Transform from './base/Transform';
import CameraController from './other/CameraController'; import CameraController from './other/CameraController';
import ContentSizeFitter from './other/ContentSizeFitter'; import ContentSizeFitter from './other/ContentSizeFitter';
import RelativeLayout from './other/RelativeLayout'; import RelativeLayout from './other/RelativeLayout';
import FullStageSize from './other/FullStageSize';
import CircleRenderer from './renderer/CircleRenderer'; import CircleRenderer from './renderer/CircleRenderer';
import FrameAnimationRenderer from './renderer/FrameAnimationRenderer'; import FrameAnimationRenderer from './renderer/FrameAnimationRenderer';
import GraphicRenderer from './renderer/GraphicRenderer'; import GraphicRenderer from './renderer/GraphicRenderer';
...@@ -41,6 +42,7 @@ export function registerAllComponents(){ ...@@ -41,6 +42,7 @@ export function registerAllComponents(){
registerDef('components/other/CameraController', CameraController); registerDef('components/other/CameraController', CameraController);
registerDef('components/other/ContentSizeFitter', ContentSizeFitter); registerDef('components/other/ContentSizeFitter', ContentSizeFitter);
registerDef('components/other/RelativeLayout', RelativeLayout); registerDef('components/other/RelativeLayout', RelativeLayout);
registerDef('components/other/FullStageSize', FullStageSize);
registerDef('components/renderer/CircleRenderer', CircleRenderer); registerDef('components/renderer/CircleRenderer', CircleRenderer);
registerDef('components/renderer/FrameAnimationRenderer', FrameAnimationRenderer); registerDef('components/renderer/FrameAnimationRenderer', FrameAnimationRenderer);
registerDef('components/renderer/GraphicRenderer', GraphicRenderer); registerDef('components/renderer/GraphicRenderer', GraphicRenderer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment