|
@@ -30,13 +30,18 @@ export class widget_base extends Component {
|
|
this.mData = data;
|
|
this.mData = data;
|
|
this.icon.getComponent(UITransform).contentSize = new Size(this.mData.att.width,this.mData.att.height)
|
|
this.icon.getComponent(UITransform).contentSize = new Size(this.mData.att.width,this.mData.att.height)
|
|
this.icon.position = new Vec3(this.mData.att.x,this.mData.att.y)
|
|
this.icon.position = new Vec3(this.mData.att.x,this.mData.att.y)
|
|
- this.icon.angle = this.mData.att.rotation
|
|
|
|
|
|
+ if(this.mData.att.rotation == undefined || this.mData.att.rotation == null) {
|
|
|
|
+ this.icon.angle = 0
|
|
|
|
+ } else {
|
|
|
|
+ this.icon.angle = this.mData.att.rotation
|
|
|
|
+ }
|
|
if(this.icon.getComponent(UIOpacity)===null){
|
|
if(this.icon.getComponent(UIOpacity)===null){
|
|
this.icon.addComponent(UIOpacity)
|
|
this.icon.addComponent(UIOpacity)
|
|
}
|
|
}
|
|
if(this.mData.att.src.length>0){
|
|
if(this.mData.att.src.length>0){
|
|
this.icon.getComponent(Sprite).spriteFrame = gameManager.getCacheSpriteFrameByName(this.icon,this.mData.att.src)
|
|
this.icon.getComponent(Sprite).spriteFrame = gameManager.getCacheSpriteFrameByName(this.icon,this.mData.att.src)
|
|
}
|
|
}
|
|
|
|
+
|
|
this.updateDir()
|
|
this.updateDir()
|
|
this.mIsShow = this.mData.att.is_show;
|
|
this.mIsShow = this.mData.att.is_show;
|
|
this.mIsActive = this.mData.att.is_interaction;
|
|
this.mIsActive = this.mData.att.is_interaction;
|
|
@@ -51,6 +56,7 @@ export class widget_base extends Component {
|
|
// ClientEvent.on(config.EventRun.NOTICE_EVENT,this.beActive.bind(this),this)
|
|
// ClientEvent.on(config.EventRun.NOTICE_EVENT,this.beActive.bind(this),this)
|
|
// ClientEvent.on(config.EventRun.WIDGET_HIDE,this.hide.bind(this),this)
|
|
// ClientEvent.on(config.EventRun.WIDGET_HIDE,this.hide.bind(this),this)
|
|
};
|
|
};
|
|
|
|
+
|
|
updateDir(){
|
|
updateDir(){
|
|
switch (this.mData.att.img_dir) {
|
|
switch (this.mData.att.img_dir) {
|
|
case config.widget_scale_dir.left:
|
|
case config.widget_scale_dir.left:
|