SetPosition() public method

change the x,y,z coordinates of the object relative to the local coordinates of the parent.
public SetPosition ( float xv, float yv, float zv ) : void
xv float x value.
yv float y value.
zv float z value.
return void
示例#1
0
 virtual protected void LayoutModalWaitPane()
 {
     if (_contentArea != null)
     {
         Vector2 pt = _frame.LocalToGlobal(Vector2.Zero);
         pt = this.GlobalToLocal(pt);
         _modalWaitPane.SetPosition((int)pt.x + _contentArea.x, (int)pt.y + _contentArea.y);
         _modalWaitPane.SetSize(_contentArea.width, _contentArea.height);
     }
     else
     {
         _modalWaitPane.SetSize(this.width, this.height);
     }
 }
示例#2
0
        /// <summary>
        /// Replace this object to another object in the display list.
        /// 在显示列表中,将指定对象取代这个图形对象。这个图形对象相当于一个占位的用途。
        /// </summary>
        /// <param name="target">Target object.</param>
        public void ReplaceMe(GObject target)
        {
            if (parent == null)
            {
                throw new Exception("parent not set");
            }

            target.name      = this.name;
            target.alpha     = this.alpha;
            target.rotation  = this.rotation;
            target.visible   = this.visible;
            target.touchable = this.touchable;
            target.grayed    = this.grayed;
            target.SetPosition(this.x, this.y);
            target.SetSize(this.width, this.height);

            int index = parent.GetChildIndex(this);

            parent.AddChildAt(target, index);
            target.relations.CopyFrom(this.relations);

            parent.RemoveChild(this, true);
        }