C# Class Defend_your_home.UI.Button

Inheritance: IGraphicsControl
Mostra file Open project: MandragoraStudio/Defend-your-home Class Usage Examples

Protected Properties

Property Type Description
font Microsoft.Xna.Framework.Graphics.SpriteFont
position Vector2
pressed bool
text string
textSize Vector2
tintColor Color
tintWhenTouched Color

Public Methods

Method Description
Button ( string text, SpriteFont font, Vector2 position ) : System
Draw ( SpriteBatch spriteBatch ) : void
Update ( ) : void

Protected Methods

Method Description
CheckIfFirstTouchDown ( Vector2 touchPosition ) : bool
CheckIfTouchRelease ( Vector2 touchPosition ) : bool
DoOnTouchDown ( ) : void
DoOnTouchRelease ( ) : void
OnClick ( EventArgs e ) : void
OnTouchDown ( EventArgs e ) : void

Method Details

Button() public method

public Button ( string text, SpriteFont font, Vector2 position ) : System
text string
font Microsoft.Xna.Framework.Graphics.SpriteFont
position Vector2
return System

CheckIfFirstTouchDown() protected method

protected CheckIfFirstTouchDown ( Vector2 touchPosition ) : bool
touchPosition Vector2
return bool

CheckIfTouchRelease() protected method

protected CheckIfTouchRelease ( Vector2 touchPosition ) : bool
touchPosition Vector2
return bool

DoOnTouchDown() protected method

protected DoOnTouchDown ( ) : void
return void

DoOnTouchRelease() protected method

protected DoOnTouchRelease ( ) : void
return void

Draw() public method

public Draw ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

OnClick() protected method

protected OnClick ( EventArgs e ) : void
e System.EventArgs
return void

OnTouchDown() protected method

protected OnTouchDown ( EventArgs e ) : void
e System.EventArgs
return void

Update() public method

public Update ( ) : void
return void

Property Details

font protected_oe property

protected SpriteFont,Microsoft.Xna.Framework.Graphics font
return Microsoft.Xna.Framework.Graphics.SpriteFont

position protected_oe property

protected Vector2 position
return Vector2

pressed protected_oe property

protected bool pressed
return bool

text protected_oe property

protected string text
return string

textSize protected_oe property

protected Vector2 textSize
return Vector2

tintColor protected_oe property

protected Color tintColor
return Color

tintWhenTouched protected_oe property

protected Color tintWhenTouched
return Color