1234567891011121314151617181920212223242526272829303132333435 |
- import { _decorator, Component, Label, Node } from 'cc';
- import { config } from '../../config';
- import { tools } from '../../tools';
- const { ccclass, property } = _decorator;
- @ccclass('attributes_dir')
- export class attributes_dir extends Component {
- @property(Node) check_select:Node = null;
- @property(Node) lab_select_zIndex:Node = null;
- private call_back = null;
- private dir = config.widget_scale_dir.normal;
- public initView(call){
- this.call_back = call;
- this.check_select.on(Node.EventType.TOUCH_END,()=>{
- tools.show_select_dir((dir:number)=>{
- this.dir = dir;
- this.update_att(this.dir)
- this.change()
- })
- })
- }
-
- change(){
- if(this.call_back!=null){
- this.call_back(this.dir)
- }
- }
- public update_att(dir:number){
- this.dir = dir;
- this.lab_select_zIndex.getComponent(Label).string = config.widget_scale_dir_map.get(this.dir)
- }
- }
|