Class Button
A predefined component that may be used as one would normally expect Ensures that the mouse was clicked and released over the button Button doesn't handle timing of press or anything like that
Constructors
Name | Description |
---|---|
this
|
Makes a button given its location |
Fields
Name | Type | Description |
---|---|---|
_location
|
AxisAlignedBoundingBox!(int,2) | Where the button is on the screen |
container
|
Display | The display that contains this component |
Properties
Name | Type | Description |
---|---|---|
isClicked [get]
|
bool | Gets whether the mouse button is held down over this button |
isHovered [get]
|
bool | Gets whether the mouse is hovering over this button |
location [get]
|
AxisAlignedBoundingBox!(int,2) | Gets where the button is on the screen |
location [set]
|
AxisAlignedBoundingBox!(int,2) | Sets where the button is on the screen |
Methods
Name | Description |
---|---|
handleEvent
|
How the button determines when it has been pressed Collects events and if the events signify the button has been pressed, calls the button's action |
draw
|
How the component should draw itself on the screen |