-
Notifications
You must be signed in to change notification settings - Fork 2
PointerStack
| Jump To | Go Back |
Arguments | Methods | Variables |
|---|
Implements: None
The PointerStack is used to create a list of PointerInterfaces that will be traversed in descending order to ensure only the top-most element is called. Thus, interfaces that are added later will be "above" those that were added earlier. In the given example, the second simple mouse pointer would be called rather than the first where the two overlap.
pointer = new PointerStack( 0, 0, room_width, room_height )
pointer.add( new PointerSimpleMouse( new ShapeRectangle( 10, 10, 20, 20 ) );
pointer.add( new PointerSimpleMouse( new ShapeRectangle( 20, 20, 20, 20 ) );| Name | Type | Purpose |
|---|---|---|
| x | int |
none provided |
| y | int |
none provided |
| width | int |
none provided |
| height | int |
none provided |
| Jump To | top |
update | remove | add | draw | is |
|---|
Returns: N/A undefined
| Name | Type | Purpose |
|---|---|---|
| _x | undef |
none provided |
| _y | undef |
none provided |
Calls for this PointerInterface to be updated, will check all instances and update the top-most interface that it finds. Any previous interactions will have their exit code called as well.
Returns: N/A undefined
| Name | Type | Purpose |
|---|---|---|
| interface | mixed |
A PointerInterface or PointerStack. |
Removes the specified interface from the stack.
Returns: N/A undefined
| Name | Type | Purpose |
|---|---|---|
| interface | mixed |
A PointerInterface or PointerStack. |
Adds the specified interface to the stack.
Returns: N/A undefined
| Name | Type | Purpose |
|---|---|---|
| _x | undef |
none provided |
| _y | undef |
none provided |
| _color | undef |
none provided |
Returns: boolean (true or false)
| Name | Type | Purpose |
|---|---|---|
| type | Constructor |
The Constructor to compare this against. |
Returns true if the provided type is PointerStack.
| Jump To | top |
|---|
- last - The last interface to be interacted with.
- content - The internal array of Interfaces being used.
- x - The x position of the PointerStack.
- y - The y position of the PointerStack.
- width - The width of the PointerStack.
- height - The height of the PointerStack.
- active - Whether or not this stack is currently active
- hold - When set to an interface element, it will not be released.
Devon Mullane 2020