示例#1
0
 public DButton( DButtonState dButtonState,string texPath, SpriteBatch spriteBatch, string buttonName)
 {
     m_buttonState = dButtonState;
     m_spriteBatch = spriteBatch;
     m_buttonColor = Color.White;
     m_curAlpha = 0.0f;
     m_flashInterval = 0.005f;
     m_buttonName = buttonName;
     InitButtonTex( texPath );
     Visible = true;
 }
示例#2
0
        public void Toggle(DButtonState state)
        {
            if (state == DButtonState.On)
            {
                UseHoverColor = false;
                BorderWidth = 2;
                buttonState = DButtonState.On;
                _texture = DrawingHelper.CreateRectangleTexture(Game.GraphicsDevice, (int)Size.X, (int)Size.Y, BorderWidth, ColorTheme.ClickedFillColor, ColorTheme.ClickedBorderColor);

            }
            else
            {
                buttonState = DButtonState.Off;
                BorderWidth = 1;
                UseHoverColor = true;
                RestoreDefaultTexture();
            }
        }