C# Class TraceRacer.Button

Represents a touchable button.
Afficher le fichier Open project: alexcoco/trace_racer Class Usage Examples

Méthodes publiques

Свойство Type Description
Alpha float
BorderColor Color
BorderThickness int
FillColor Color
Position Vector2
Size Vector2
Text string
TextColor Color

Méthodes publiques

Méthode Description
Button ( string text ) : System

Creates a new Button.

Draw ( GameScreen screen ) : void

Draws the button

HandleTap ( Vector2 tap ) : bool

Passes a tap location to the button for handling.

Méthodes protégées

Méthode Description
OnTapped ( ) : void

Invokes the Tapped event and allows subclasses to perform actions when tapped.

Method Details

Button() public méthode

Creates a new Button.
public Button ( string text ) : System
text string The text to display in the button.
Résultat System

Draw() public méthode

Draws the button
public Draw ( GameScreen screen ) : void
screen GameScreen The screen drawing the button
Résultat void

HandleTap() public méthode

Passes a tap location to the button for handling.
public HandleTap ( Vector2 tap ) : bool
tap Vector2 The location of the tap.
Résultat bool

OnTapped() protected méthode

Invokes the Tapped event and allows subclasses to perform actions when tapped.
protected OnTapped ( ) : void
Résultat void

Property Details

Alpha public_oe property

The opacity of the button.
public float Alpha
Résultat float

BorderColor public_oe property

The color of the button border.
public Color BorderColor
Résultat Color

BorderThickness public_oe property

The thickness of the border drawn for the button.
public int BorderThickness
Résultat int

FillColor public_oe property

The color of the button background.
public Color FillColor
Résultat Color

Position public_oe property

The position of the top-left corner of the button.
public Vector2 Position
Résultat Vector2

Size public_oe property

The size of the button.
public Vector2 Size
Résultat Vector2

Text public_oe property

The text displayed in the button.
public string Text
Résultat string

TextColor public_oe property

The color of the text.
public Color TextColor
Résultat Color