C# Класс MoodSwingGUI.MSButton

MSButton represents a drawable, clickable, action-attachable button.
Наследование: MSGUITypable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
action MSAction
clickedTexture Microsoft.Xna.Framework.Graphics.Texture2D
hoveredTexture Microsoft.Xna.Framework.Graphics.Texture2D
unhoveredTexture Microsoft.Xna.Framework.Graphics.Texture2D

Открытые методы

Метод Описание
Draw ( GameTime gameTime ) : void
HandleKeyboardInput ( KeyboardState oldKeyboardState ) : void
Hover ( ) : void
LeftClick ( ) : void
MSButton ( MSLabel label, MSAction action, Rectangle boundingRectangle, Microsoft.Xna.Framework.Graphics.Texture2D unhovered, Microsoft.Xna.Framework.Graphics.Texture2D clicked, Microsoft.Xna.Framework.Graphics.Texture2D hovered, Color highlight, MSToolTip toolTip, Shape shape, SpriteBatch spriteBatch, Microsoft.Xna.Framework.Game game ) : System

Constructs an MSButton.

MSButton ( MSLabel label, MSAction action, Rectangle boundingRectangle, Microsoft.Xna.Framework.Graphics.Texture2D unhovered, Microsoft.Xna.Framework.Graphics.Texture2D clicked, Microsoft.Xna.Framework.Graphics.Texture2D hovered, MSToolTip toolTip, Shape shape, SpriteBatch spriteBatch, Microsoft.Xna.Framework.Game game ) : System

Constructs an MSButton with no highlight.

MiddleClick ( ) : void
RightClick ( ) : void
UnHover ( ) : void
UnLeftClick ( ) : void
UnLeftClickNoAction ( ) : void
UnMiddleClick ( ) : void
UnRightClick ( ) : void

Описание методов

Draw() публичный Метод

public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Результат void

HandleKeyboardInput() публичный Метод

public HandleKeyboardInput ( KeyboardState oldKeyboardState ) : void
oldKeyboardState Microsoft.Xna.Framework.Input.KeyboardState
Результат void

Hover() публичный Метод

public Hover ( ) : void
Результат void

LeftClick() публичный Метод

public LeftClick ( ) : void
Результат void

MSButton() публичный Метод

Constructs an MSButton.
public MSButton ( MSLabel label, MSAction action, Rectangle boundingRectangle, Microsoft.Xna.Framework.Graphics.Texture2D unhovered, Microsoft.Xna.Framework.Graphics.Texture2D clicked, Microsoft.Xna.Framework.Graphics.Texture2D hovered, Color highlight, MSToolTip toolTip, Shape shape, SpriteBatch spriteBatch, Microsoft.Xna.Framework.Game game ) : System
label MSLabel Add text to this MSButton with an MSLabel. Use null if you don't need to add text. Make sure to position the MSLabel relative to the upper-left corner of this MSButton.
action MSAction will be executed when this MSButton is clicked
boundingRectangle Microsoft.Xna.Framework.Rectangle the bounding Rectangle of thisMSButton
unhovered Microsoft.Xna.Framework.Graphics.Texture2D will be drawn when this MSButton is unhovered
clicked Microsoft.Xna.Framework.Graphics.Texture2D will be drawn when this MSButton is pressed and hovered
hovered Microsoft.Xna.Framework.Graphics.Texture2D will be drawn when this MSButton is released and hovered
highlight Color the Color to overlay this MSButton with
toolTip MSToolTip
shape Shape the Shape of this MSButton
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch the SpriteBatch that will draw this MSButton
game Microsoft.Xna.Framework.Game the Game where this MSButton will be used
Результат System

MSButton() публичный Метод

Constructs an MSButton with no highlight.
public MSButton ( MSLabel label, MSAction action, Rectangle boundingRectangle, Microsoft.Xna.Framework.Graphics.Texture2D unhovered, Microsoft.Xna.Framework.Graphics.Texture2D clicked, Microsoft.Xna.Framework.Graphics.Texture2D hovered, MSToolTip toolTip, Shape shape, SpriteBatch spriteBatch, Microsoft.Xna.Framework.Game game ) : System
label MSLabel Add text to this MSButton with an MSLabel. Use null if you don't need to add text. Make sure to position the MSLabel relative to the upper-left corner of this MSButton.
action MSAction will be executed when this MSButton is clicked
boundingRectangle Microsoft.Xna.Framework.Rectangle the bounding Rectangle of this MSButton
unhovered Microsoft.Xna.Framework.Graphics.Texture2D will be drawn when this MSButton is unhovered
clicked Microsoft.Xna.Framework.Graphics.Texture2D will be drawn when this MSButton is pressed and hovered
hovered Microsoft.Xna.Framework.Graphics.Texture2D will be drawn when this MSButton is released and hovered
toolTip MSToolTip
shape Shape the Shape of this MSButton
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch the SpriteBatch that will draw this MSButton
game Microsoft.Xna.Framework.Game the Game where this MSButton will be used
Результат System

MiddleClick() публичный Метод

public MiddleClick ( ) : void
Результат void

RightClick() публичный Метод

public RightClick ( ) : void
Результат void

UnHover() публичный Метод

public UnHover ( ) : void
Результат void

UnLeftClick() публичный Метод

public UnLeftClick ( ) : void
Результат void

UnLeftClickNoAction() публичный Метод

public UnLeftClickNoAction ( ) : void
Результат void

UnMiddleClick() публичный Метод

public UnMiddleClick ( ) : void
Результат void

UnRightClick() публичный Метод

public UnRightClick ( ) : void
Результат void

Описание свойств

action защищенное свойство

protected MSAction action
Результат MSAction

clickedTexture защищенное свойство

protected Texture2D,Microsoft.Xna.Framework.Graphics clickedTexture
Результат Microsoft.Xna.Framework.Graphics.Texture2D

hoveredTexture защищенное свойство

protected Texture2D,Microsoft.Xna.Framework.Graphics hoveredTexture
Результат Microsoft.Xna.Framework.Graphics.Texture2D

unhoveredTexture защищенное свойство

protected Texture2D,Microsoft.Xna.Framework.Graphics unhoveredTexture
Результат Microsoft.Xna.Framework.Graphics.Texture2D