widget_container.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import { _decorator, Component, Node, Size, UITransform } from 'cc';
  2. import { widget_base } from './widget_base';
  3. import { att_container } from '../../../data/data';
  4. const { ccclass, property } = _decorator;
  5. @ccclass('widget_container')
  6. export class widget_container extends widget_base {
  7. @property(Node) img_zhaobutong:Node = null;
  8. private mContainerData:att_container = null;
  9. protected init(): void {
  10. if(this.mData.att.container_layer!=null){
  11. this.mContainerData = this.mData.att.container_layer
  12. }
  13. }
  14. protected update(dt: number): void {
  15. // let node = this.getIcon()
  16. // let origin_width = this.mData.att.width
  17. // let origin_height = this.mData.att.height
  18. // let cur_width = node.getComponent(UITransform).contentSize.width
  19. // let cur_height = node.getComponent(UITransform).contentSize.height
  20. // let scaleX = cur_width/origin_width
  21. // let scaleY = cur_height/origin_height
  22. // for (let index = 0; index < node.children.length; index++) {
  23. // const element = node.children[index];
  24. // element.setScale(scaleX,scaleY,1)
  25. // }
  26. }
  27. }