Example #1
0
        public override Scene.SceneObj OnCopy()
        {
            UI_PanelFold e = new UI_PanelFold(this.foldElement.Size,this.unfoldElement.Size);
            //this
            e.anim = this.anim;
            e.fold = this.fold;

            if (this.Children==null|| !this.Children.Contains(foldElement))
            {
                e.foldElement= foldElement.Copy() as UI_Panel;
            }
            if (this.Children == null || !this.Children.Contains(unfoldElement))
            {
                e.unfoldElement = unfoldElement.Copy() as UI_Panel;
            }
            //panel
            e.borderleft = this.borderleft;
            e.bordertop = this.bordertop;
            e.borderright = this.borderright;
            e.borderbottom = this.borderbottom;
            //uielement
            e.Text = this.Text;
            e.Orient = this.Orient;
            e.Size = this.Size;
            e.posHAlign = this.posHAlign;
            e.posVAlign = this.posVAlign;
            e.ClipRender = this.ClipRender;
            //scene
            e._pos = this._pos;
            e._scale = this._scale;
            e.needUpdate = true;

            return e;
        }
Example #2
0
        public override Scene.SceneObj OnCopy()
        {
            UI_PanelFold e = new UI_PanelFold(this.foldElement.Size, this.unfoldElement.Size);

            //this
            e.anim = this.anim;
            e.fold = this.fold;

            if (this.Children == null || !this.Children.Contains(foldElement))
            {
                e.foldElement = foldElement.Copy() as UI_Panel;
            }
            if (this.Children == null || !this.Children.Contains(unfoldElement))
            {
                e.unfoldElement = unfoldElement.Copy() as UI_Panel;
            }
            //panel
            e.borderleft   = this.borderleft;
            e.bordertop    = this.bordertop;
            e.borderright  = this.borderright;
            e.borderbottom = this.borderbottom;
            //uielement
            e.Text       = this.Text;
            e.Orient     = this.Orient;
            e.Size       = this.Size;
            e.posHAlign  = this.posHAlign;
            e.posVAlign  = this.posVAlign;
            e.ClipRender = this.ClipRender;
            //scene
            e._pos       = this._pos;
            e._scale     = this._scale;
            e.needUpdate = true;



            return(e);
        }
Example #3
0
        public void defSelectElement(object obj, UIElement uie, bool select)
        {
            SceneObjText text = uie as SceneObjText;

            if (text != null)
            {
                text.color = select ? Color.Red : Color.White;
                if (select)
                {
                    text.Size.Y   = baseelement.Size.Y * 2.0f;
                    text.Orient.Y = -baseelement.Size.Y / 2;
                }
                else
                {
                    text.Size.Y   = baseelement.Size.Y;
                    text.Orient.Y = 0;
                }
                text.needUpdate = true;
            }
            else
            {
                UI_PanelFold pf = uie as UI_PanelFold;
                if (pf != null)
                {
                    if (select)
                    {
                        pf.UnFold();
                    }
                    else
                    {
                        pf.Fold();
                    }
                    pf.needUpdate = true;
                }
            }
        }