file: DoorComponent.aus

class: DoorComponent

[30:7] extends: Component

Wraps FXGL's DoorComponent (com.almasb.fxgl.scene3d.DoorComponent), a Component that adds a 3D door (frame, panel, and handle) to its Entity and animates the panel open / closed in response to the Entity's ActivatorComponent. DoorComponent is the panel half of the experimental door prefab built by Prefabs.newDoor; it also requires the ActivatorComponent to drive its open / close transitions. For ad-hoc setup, attach both an ActivatorComponent and a DoorComponent to your Entity; toggling the activator (activator.press) plays the open or close animation. Note: the DoorComponent constructor builds its open Animation through FXGL's DSL animationBuilder, which requires a running FXGL engine. Construct DoorComponent only after the game has launched (e.g. from inside onInitGame), or obtain one through Prefabs.newDoor.

Methods