-
Notifications
You must be signed in to change notification settings - Fork 6
ControlBase.cs
This class is derived from DrawableGameComponent and implements the IHasTransform interface. It is the base classed used for all the UI elements.
MouseOver OnMouseOverEvent
Caleed when the mouse pointer is over the control.
MouseEnter OnMouseEnterEvent
Fired when the mouse leaves the control.
MouseLeave OnMouseLeaveEvent
Is called when the mouse pointer leaves the bounds of the control.
MouseButtonDown OnMouseButtonDownEvent
Fired when over control and mouse button is down.
MouseClick OnMouseClickEvent
Is called when the mouse pointer is over the control, and the mouse is clicked.
GotFocus OnGotFocusEvent
Is called when the control has focus.
LostFocus OnLostFocusEvent
Is called when the control loses focus.
Used to load the texture to be used for the background.
The size of the control eb be rendered.
This has be be the screen position of the control as it is used when detecting mouse intersects.
Scissor rectangle to stop control overflow.
Transform Transform
Transform used for position, scale and rotation..
Color to render the bounds in when required..
Color to render the background in.
Used to state if we want to render the bounds rectangle or not.
The thickness of the border we want to render, defaults to 1,1
Color of the border to be rendered.
Indicates if this control has focus...
Indicates if the mouse is over the current control.
List of the children to be rendered (if any).
This is the class constructor, when called various defaults are initialized.
Initializes it's self and calls Initialize on any children it has.
Sets up it's internal SpriteBatch and default textures.
Update method manages event detection, and iterates through children calling their updates.
Draws it's own back ground, then iterates through children calling their draw calls.
Sets the control as having focus.
Brings the control to to end of the draw order, so drawing it on top of all other elements.
Used to set up the SpriteBatch draw call, setting scissor rectangles as needed.
Ends draw call and puts the scissor rectangle back as it was in the graphics device.
Used for testing where the bounds rectangle is located.
Method to add a child control. If this HasInitialized it true, then children are initialized as added.
Removes child from Child list.