Commit 542cf045 authored by rockyl's avatar rockyl

修改tween,增加host

parent 1fcc68a6
......@@ -7,12 +7,14 @@ const commonjs = require('rollup-plugin-commonjs');
const typescript = require('rollup-plugin-typescript2');
const {uglify} = require('rollup-plugin-uglify');
const name = 'scilla-components';
export default {
input: 'src/index.ts',
output: {
file: 'dist/bundle.js',
file: `dist/${name}.js`,
format: 'umd',
name: 'scilla-components',
name,
//sourcemap: true,
},
plugins: [
......@@ -23,6 +25,7 @@ export default {
typescript: require('typescript'),
tslib: require('tslib'),
useTsconfigDeclarationDir: true,
declaration: false,
}),
commonjs(),
//uglify({}),
......
......@@ -11,7 +11,15 @@ import {getStageSize, ScillaComponent, } from "scilla";
export default class FullStageSize extends ScillaComponent {
once: boolean = true;
private stageSize;
private _stageSize;
get stageSize(){
if(!this._stageSize){
this._stageSize = getStageSize();
}
return this._stageSize;
}
onCreate() {
super.onCreate();
......@@ -20,8 +28,6 @@ export default class FullStageSize extends ScillaComponent {
onAwake() {
super.onAwake();
this.stageSize = getStageSize();
this.execute();
}
......@@ -33,6 +39,12 @@ export default class FullStageSize extends ScillaComponent {
}
}
onEditorUpdate(t) {
super.onEditorUpdate(t);
this.execute();
}
execute() {
const {width, height} = this.stageSize;
......
......@@ -14,6 +14,7 @@ import Transform from './base/Transform';
import CameraController from './other/CameraController';
import ContentSizeFitter from './other/ContentSizeFitter';
import RelativeLayout from './other/RelativeLayout';
import FullStageSize from './other/FullStageSize';
import CircleRenderer from './renderer/CircleRenderer';
import FrameAnimationRenderer from './renderer/FrameAnimationRenderer';
import GraphicRenderer from './renderer/GraphicRenderer';
......@@ -41,6 +42,7 @@ export function registerAllComponents(){
registerDef('components/other/CameraController', CameraController);
registerDef('components/other/ContentSizeFitter', ContentSizeFitter);
registerDef('components/other/RelativeLayout', RelativeLayout);
registerDef('components/other/FullStageSize', FullStageSize);
registerDef('components/renderer/CircleRenderer', CircleRenderer);
registerDef('components/renderer/FrameAnimationRenderer', FrameAnimationRenderer);
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