page_btn.ts 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { _decorator, Component, Node, Color, Label } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('page_btn')
  4. export class page_btn extends Component {
  5. @property(Node)
  6. select_status_node: Node = null;
  7. @property(Node)
  8. unselect_status_node: Node = null;
  9. @property(Node)
  10. lab: Node = null;
  11. color:Color = new Color()
  12. start() {
  13. }
  14. status_select(){
  15. this.select_status_node.active = true;
  16. this.unselect_status_node.active = false;
  17. if(this.lab!=null){
  18. this.lab.getComponent(Label).color = this.color.fromHEX("#FFFFFF")
  19. }
  20. }
  21. isSelect(){
  22. return this.select_status_node.active;
  23. }
  24. status_unselect(){
  25. this.select_status_node.active = false;
  26. this.unselect_status_node.active = true;
  27. if(this.lab!=null){
  28. this.lab.getComponent(Label).color = this.color.fromHEX("#A48C80")
  29. }
  30. }
  31. update(deltaTime: number) {
  32. }
  33. }