问题描述:
当一个界面有多张可以拖动图片的时候,图片会有一个层级显示问题,所以需要修改物体的序列层级
例如:同一界面有四个图片
//图片可以移动设置
this.UIView.m_Item4.draggable = true;
this.UIView.m_Item1.on(fairygui.Events.DRAG_START, this, this.onDragStartItem1);
//获取层级取值范围
this.indexNum = Math.max(this.UIView.m_Item1.parent.getChildIndex(this.UIView.m_Item1), this.UIView.m_Item1.parent.getChildIndex(this.UIView.m_Item4));
//将物体修改
onDragStartItem1() {
this.UIView.m_Item1.parent.setChildIndex(this.UIView.m_Item1, this.indexNum);
}