|
@@ -26,6 +26,7 @@ import { attributes_show } from './attributes/attributes_show';
|
|
|
import { attributes_scene_setting } from './attributes/attributes_scene_setting';
|
|
|
import { attributes_remark } from './attributes/attributes_remark';
|
|
|
import { attributes_rotation } from './attributes/attributes_rotation';
|
|
|
+import { attributes_anchor } from './attributes/attributes_anchor';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('Attributes')
|
|
@@ -35,6 +36,7 @@ export class Attributes extends Component {
|
|
|
@property(Node) attributes_remark:Node = null;
|
|
|
@property(Node) attributes_x_y:Node = null;
|
|
|
@property(Node) attributes_w_h:Node = null;
|
|
|
+ @property(Node) attributes_anchor:Node = null;
|
|
|
@property(Node) attributes_rotation:Node = null;
|
|
|
@property(Node) attributes_res:Node = null;
|
|
|
@property(Node) attributes_origin:Node = null;
|
|
@@ -66,6 +68,7 @@ export class Attributes extends Component {
|
|
|
this.attributes_map.set("remark",this.attributes_remark)
|
|
|
this.attributes_map.set("pos",this.attributes_x_y)
|
|
|
this.attributes_map.set("size",this.attributes_w_h)
|
|
|
+ this.attributes_map.set("anchor",this.attributes_anchor)
|
|
|
this.attributes_map.set("rotation",this.attributes_rotation)
|
|
|
this.attributes_map.set("url",this.attributes_res)
|
|
|
this.attributes_map.set("origin",this.attributes_origin)
|
|
@@ -104,6 +107,7 @@ export class Attributes extends Component {
|
|
|
this.attributes_w_h.getComponent(attributes_w_h).initView(this.onChangeSize.bind(this))
|
|
|
this.attributes_x_y.getComponent(attributes_x_y).initView(this.onChangePos.bind(this))
|
|
|
this.attributes_rotation.getComponent(attributes_rotation).initView(this.onChangeRotation.bind(this))
|
|
|
+ this.attributes_anchor.getComponent(attributes_anchor).initView(this.onChangeAnchor.bind(this))
|
|
|
this.attributes_origin.getComponent(attributes_origin).initView(this.onChangeOrigin.bind(this))
|
|
|
this.hideAllAtt()
|
|
|
}
|
|
@@ -113,6 +117,12 @@ export class Attributes extends Component {
|
|
|
ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.remark)
|
|
|
}
|
|
|
|
|
|
+ onChangeAnchor(anchor:Vec2){
|
|
|
+ this.cur_att_data.anchor_x = anchor.x
|
|
|
+ this.cur_att_data.anchor_y = anchor.y
|
|
|
+ ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.anchor)
|
|
|
+ }
|
|
|
+
|
|
|
onChangeRotation(rotation: number) {
|
|
|
this.cur_att_data.rotation = rotation
|
|
|
ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.rotation)
|
|
@@ -234,6 +244,7 @@ export class Attributes extends Component {
|
|
|
this.attributes_map.get("text_sound").active = false;
|
|
|
this.attributes_map.get("count_down").active = false;
|
|
|
this.attributes_map.get("z_index").active = false;
|
|
|
+ this.attributes_map.get("anchor").active = true;
|
|
|
this.attributes_map.get("rotation").active = true;
|
|
|
if(data.widget_type===config.Widget_Type_List.DRAG_TYPE){
|
|
|
this.attributes_map.get("drop").active = true;
|
|
@@ -257,6 +268,7 @@ export class Attributes extends Component {
|
|
|
this.attributes_map.get("pos").active = false;
|
|
|
this.attributes_map.get("size").active = false;
|
|
|
this.attributes_map.get("text_sound").active = true;
|
|
|
+ this.attributes_map.get("anchor").active = false;
|
|
|
this.attributes_map.get("rotation").active = false;
|
|
|
}else if(data.widget_type===config.Widget_Type_List.QUESTION_SELECT){
|
|
|
this.attributes_map.get("animation").active = false;
|
|
@@ -266,6 +278,7 @@ export class Attributes extends Component {
|
|
|
this.attributes_map.get("size").active = false;
|
|
|
this.attributes_map.get("pos").active = true;
|
|
|
this.attributes_map.get("question_select").active = true;
|
|
|
+ this.attributes_map.get("anchor").active = false;
|
|
|
this.attributes_map.get("rotation").active = false;
|
|
|
}else if(data.widget_type===config.Widget_Type_List.COUNT_DOWN){
|
|
|
this.attributes_map.get("animation").active = false;
|
|
@@ -274,6 +287,7 @@ export class Attributes extends Component {
|
|
|
this.attributes_map.get("pos").active = true;
|
|
|
this.attributes_map.get("size").active = false;
|
|
|
this.attributes_map.get("count_down").active = true;
|
|
|
+ this.attributes_map.get("anchor").active = false;
|
|
|
this.attributes_map.get("rotation").active = false;
|
|
|
}
|
|
|
}else if(data.type===config.attributes_type.scene){
|
|
@@ -284,6 +298,7 @@ export class Attributes extends Component {
|
|
|
this.attributes_map.get("url").active = true;
|
|
|
this.attributes_map.get("animation").active = true;
|
|
|
this.attributes_map.get("scene_set").active = true;
|
|
|
+ this.attributes_map.get("anchor").active = false;
|
|
|
this.attributes_map.get("rotation").active = false;
|
|
|
this.attributes_map.get("be_active").active = true;
|
|
|
}
|
|
@@ -310,6 +325,9 @@ export class Attributes extends Component {
|
|
|
let size = this.getSizeCom()
|
|
|
size.update_att(this.cur_att_data.width,this.cur_att_data.height)
|
|
|
|
|
|
+ let anchor = this.getAnchorCom()
|
|
|
+ anchor.update_att(this.cur_att_data.anchor_x, this.cur_att_data.anchor_y)
|
|
|
+
|
|
|
let rotation = this.getRotationCom()
|
|
|
rotation.update_att(this.cur_att_data.rotation)
|
|
|
|
|
@@ -424,6 +442,10 @@ export class Attributes extends Component {
|
|
|
return this.attributes_map.get("size").getComponent(attributes_w_h);
|
|
|
}
|
|
|
|
|
|
+ getAnchorCom() {
|
|
|
+ return this.attributes_map.get("anchor").getComponent(attributes_anchor);
|
|
|
+ }
|
|
|
+
|
|
|
getRotationCom(){
|
|
|
return this.attributes_map.get("rotation").getComponent(attributes_rotation);
|
|
|
}
|