FairyGUI.GObject.SetPosition C# (CSharp) Method

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
        public void SetPosition(float xv, float yv, float zv)
        {
            if (_x != xv || _y != yv || _z != zv)
            {
                float dx = xv - _x;
                float dy = yv - _y;
                _x = xv;
                _y = yv;
                _z = zv;

                HandlePositionChanged();

                if (this is GGroup)
                    ((GGroup)this).MoveChildren(dx, dy);

                UpdateGear(1);

                if (parent != null && !(parent is GList))
                {
                    parent.SetBoundsChangedFlag();
                    onPositionChanged.Call();
                }

                if (draggingObject == this && !sUpdateInDragging)
                    sGlobalRect = this.LocalToGlobal(new Rect(0, 0, this.width, this.height));
            }
        }

Usage Example

示例#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);
     }
 }
All Usage Examples Of FairyGUI.GObject::SetPosition