FullscreenComponent
Summary
This component is responsible for adding a button in the top menu to toggle fullscreen mode.
Constructor
FullscreenComponent
Syntax
FullscreenComponent
(
-
core
Summary
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
destroy
Syntax
destroy
()
Summary
Called when the component is destroyed. The menu item is removed.
disable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentgetTargeted
Syntax
Summary
Finds out if the given position is over an element handled by the componentParameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
Object:
The targeted element, or null if nothing is found.
initialize
Syntax
initialize
()
Summary
Initializes the component by adding a new entry in the top menu.
onContextChanged
Syntax
onContextChanged
(
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context
onFullScreenChange
Syntax
onFullScreenChange
(
-
event
Summary
Called when the fullscreen mode is changed (on or off) to update the fullscreen button.
Parameters:
-
event
ObjectThe event object.
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.toggleFullscreen
Syntax
toggleFullscreen
(
-
event
Summary
Toggles fullscreen mode.
Triggered on wnp.request.toggleFullscreen
.
Parameters:
-
event
ObjectThe event object.
update
Syntax
update
()
Summary
Generic update method, called on every frameProperties
priority
Syntax
priority
Number
Summary
Priority of the component in the "update" and "draw" routinesstructure
Syntax
structure
wnp.Structure
Summary
Structure file instance (shortcut to wanaplan.structure). This is the base object where the whole plan is savedEvents
wnp.request.toggleFullscreen
Syntax
wnp.request.toggleFullscreen
Summary
Fired when the user clicks on the fullscreen toggle button.