Ejemplo n.º 1
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Copy constructor
        /// </summary>
        ///
        /// <param name="copy">Instance to copy</param>
        ///
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public Button(Button copy)
            : base(copy)
        {
            SpaceKeyPressedCallback = copy.SpaceKeyPressedCallback;
            ReturnKeyPressedCallback = copy.ReturnKeyPressedCallback;

            m_LoadedConfigFile   = copy.m_LoadedConfigFile;
            m_SplitImage         = copy.m_SplitImage;
            m_SeparateHoverImage = copy.m_SeparateHoverImage;
            m_Text               = new Text(copy.m_Text);
            m_TextSize           = copy.m_TextSize;

            Global.TextureManager.CopyTexture(copy.m_TextureNormal_L, m_TextureNormal_L);
            Global.TextureManager.CopyTexture(copy.m_TextureNormal_M, m_TextureNormal_M);
            Global.TextureManager.CopyTexture(copy.m_TextureNormal_R, m_TextureNormal_R);
            Global.TextureManager.CopyTexture(copy.m_TextureHover_L, m_TextureHover_L);
            Global.TextureManager.CopyTexture(copy.m_TextureHover_M, m_TextureHover_M);
            Global.TextureManager.CopyTexture(copy.m_TextureHover_R, m_TextureHover_R);
            Global.TextureManager.CopyTexture(copy.m_TextureDown_L, m_TextureDown_L);
            Global.TextureManager.CopyTexture(copy.m_TextureDown_M, m_TextureDown_M);
            Global.TextureManager.CopyTexture(copy.m_TextureDown_R, m_TextureDown_R);
            Global.TextureManager.CopyTexture(copy.m_TextureFocused_L, m_TextureFocused_L);
            Global.TextureManager.CopyTexture(copy.m_TextureFocused_M, m_TextureFocused_M);
            Global.TextureManager.CopyTexture(copy.m_TextureFocused_R, m_TextureFocused_R);
        }
Ejemplo n.º 2
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Copy constructor
        /// </summary>
        ///
        /// <param name="copy">Instance to copy</param>
        ///
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public ChildWindow(ChildWindow copy)
            : base(copy)
        {
            ClosedCallback = copy.ClosedCallback;
            MovedCallback = copy.MovedCallback;

            m_LoadedConfigFile  = copy.m_LoadedConfigFile;
            m_Size              = copy.m_Size;
            m_BackgroundColor   = copy.m_BackgroundColor;
            m_BackgroundTexture = copy.m_BackgroundTexture;
            m_TitleText         = new Text(copy.m_TitleText);
            m_TitleBarHeight    = copy.m_TitleBarHeight;
            m_SplitImage        = copy.m_SplitImage;
            m_DraggingPosition  = copy.m_DraggingPosition;
            m_DistanceToSide    = copy.m_DistanceToSide;
            m_TitleAlignment    = copy.m_TitleAlignment;
            m_BorderColor       = copy.m_BorderColor;
            m_Borders           = copy.m_Borders;
            m_CloseButton       = new Button(copy.m_CloseButton);
            m_KeepInParent      = copy.m_KeepInParent;

            Global.TextureManager.CopyTexture(copy.m_IconTexture, m_IconTexture);
            Global.TextureManager.CopyTexture(copy.m_TextureTitleBar_L, m_TextureTitleBar_L);
            Global.TextureManager.CopyTexture(copy.m_TextureTitleBar_M, m_TextureTitleBar_M);
            Global.TextureManager.CopyTexture(copy.m_TextureTitleBar_R, m_TextureTitleBar_R);

            if (copy.m_BackgroundTexture != null)
            {
                m_BackgroundSprite.Texture = m_BackgroundTexture;
                m_BackgroundSprite.Scale = new Vector2f(m_Size.X / m_BackgroundTexture.Size.X, m_Size.Y / m_BackgroundTexture.Size.Y);
                m_BackgroundSprite.Color = new Color (255, 255, 255, m_Opacity);
            }
        }