DynamicDomAttach
Constructor Summary
| Public Constructor | ||
| public |
constructor(root: GameRoot, element: HTMLElement, param2: object) |
|
Member Summary
| Public Members | ||
| public |
attachClass: * |
|
| public |
|
|
| public |
|
|
| public |
element: HTMLElement |
|
| public |
|
|
| public |
lastComputedBounds: DOMRect |
|
| public |
|
|
| public |
|
|
| public |
parent: * |
|
| public |
|
|
| public |
|
|
| public |
trackHover: * |
|
| public |
|
|
Method Summary
| Public Methods | ||
| public |
Internal method to attach the element |
|
| public |
Internal method to detach the element |
|
| public |
isAttached(): * Returns whether the element is currently attached |
|
| public |
setIsHoveredClass(isHovered: boolean) Actually sets the 'hovered' class |
|
| public |
Call this every frame, and the dom attach class will take care of everything else |
|
Public Constructors
public constructor(root: GameRoot, element: HTMLElement, param2: object) source
Params:
| Name | Type | Attribute | Description |
| root | GameRoot | ||
| element | HTMLElement | ||
| param2 | object | ||
| param2.timeToKeepSeconds | number= | How long to keep the element visible (in ms) after it should be hidden. Useful for fade-out effects |
|
| param2.attachClass | string= | If set, attaches a class while the element is visible |
|
| param2.trackHover | boolean= | If set, attaches the 'hovered' class if the cursor is above the element. Useful for fading out the element if its below the cursor for example. |
