C# Class Flood.GUI.Controls.Canvas

Canvas control. It should be the root parent for all other controls.
Inheritance: Control
Exibir arquivo Open project: FloodProject/flood Class Usage Examples

Public Methods

Method Description
AddDelayedDelete ( Control control ) : void

Adds given control to the delete queue and detaches it from canvas. Don't call from Dispose, it modifies child list.

Canvas ( Skins skin ) : System

Initializes a new instance of the Canvas class.

Dispose ( ) : void
GetCanvas ( ) : Canvas
Input_Character ( char chr ) : bool

Handles keyboard events. Called from Input subsystems.

Input_Key ( Keys key, bool down ) : bool

Handles keyboard events. Called from Input subsystems.

Input_MouseButton ( int button, bool down ) : bool

Handles mouse button events. Called from Input subsystems.

Input_MouseMoved ( int x, int y, int dx, int dy ) : bool

Handles mouse movement events. Called from Input subsystems.

Input_MouseWheel ( int val ) : bool

Handles the mouse wheel events. Called from Input subsystems.

Redraw ( ) : void

Re-renders the control, invalidates cached texture.

RenderCanvas ( ) : void

Renders the canvas. Call in your rendering loop.

Protected Methods

Method Description
Initialize ( ) : void

Additional initialization (which is sometimes not appropriate in the constructor)

OnBoundsChanged ( Rectangle oldBounds ) : void

Handler invoked when control's bounds change.

Render ( Skins skin ) : void

Renders the control using specified skin.

Private Methods

Method Description
ProcessDelayedDeletes ( ) : void
Update ( ) : void

Processes input and layout. Also purges delayed delete queue.

Method Details

AddDelayedDelete() public method

Adds given control to the delete queue and detaches it from canvas. Don't call from Dispose, it modifies child list.
public AddDelayedDelete ( Control control ) : void
control Control Control to delete.
return void

Canvas() public method

Initializes a new instance of the Canvas class.
public Canvas ( Skins skin ) : System
skin Skins Skin to use.
return System

Dispose() public method

public Dispose ( ) : void
return void

GetCanvas() public method

public GetCanvas ( ) : Canvas
return Canvas

Initialize() protected method

Additional initialization (which is sometimes not appropriate in the constructor)
protected Initialize ( ) : void
return void

Input_Character() public method

Handles keyboard events. Called from Input subsystems.
public Input_Character ( char chr ) : bool
chr char
return bool

Input_Key() public method

Handles keyboard events. Called from Input subsystems.
public Input_Key ( Keys key, bool down ) : bool
key Keys
down bool
return bool

Input_MouseButton() public method

Handles mouse button events. Called from Input subsystems.
public Input_MouseButton ( int button, bool down ) : bool
button int
down bool
return bool

Input_MouseMoved() public method

Handles mouse movement events. Called from Input subsystems.
public Input_MouseMoved ( int x, int y, int dx, int dy ) : bool
x int
y int
dx int
dy int
return bool

Input_MouseWheel() public method

Handles the mouse wheel events. Called from Input subsystems.
public Input_MouseWheel ( int val ) : bool
val int
return bool

OnBoundsChanged() protected method

Handler invoked when control's bounds change.
protected OnBoundsChanged ( Rectangle oldBounds ) : void
oldBounds Rectangle Old bounds.
return void

Redraw() public method

Re-renders the control, invalidates cached texture.
public Redraw ( ) : void
return void

Render() protected method

Renders the control using specified skin.
protected Render ( Skins skin ) : void
skin Skins Skin to use.
return void

RenderCanvas() public method

Renders the canvas. Call in your rendering loop.
public RenderCanvas ( ) : void
return void