コード例 #1
0
        /// <summary>
        /// Clones (deep copies) the GUI Sprite
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            GUISprite ret = new GUISprite();

            if (ret == null)
            {
                throw new OutOfMemoryException("GUISprite.Clone() failed its allocation.");
            }

            // GUIControl level copy
            ret.ID          = this.ID;
            ret.Parent      = this.Parent;
            ret.Name        = this.Name;
            ret.Layout      = this.Layout.Clone() as SpriteLayout;
            ret.Scene       = this.Scene;
            ret.AnchorFlags = this.AnchorFlags;
            ret.Mask        = this.Mask;

            // GUISprite level copy
            ret.TextureID = this.TextureID;
            ret.Skew      = this.Skew;
            ret.Flip      = this.Flip;

            return(ret);
        }
コード例 #2
0
ファイル: GUISprite.cs プロジェクト: RasterCode/OtterUI
        /// <summary>
        /// Clones (deep copies) the GUI Sprite
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            GUISprite ret = new GUISprite();
            if (ret == null)
                throw new OutOfMemoryException("GUISprite.Clone() failed its allocation.");

            // GUIControl level copy
            ret.ID              = this.ID;
            ret.Parent          = this.Parent;
            ret.Name            = this.Name;
            ret.Layout          = this.Layout.Clone() as SpriteLayout;
            ret.Scene           = this.Scene;
            ret.AnchorFlags     = this.AnchorFlags;
            ret.Mask            = this.Mask;

            // GUISprite level copy
            ret.TextureID       = this.TextureID;
            ret.Skew            = this.Skew;
            ret.Flip            = this.Flip;

            return ret;
        }