OvertureComponent2D
Summary
Overture component 2D.
Constructor
OvertureComponent2D
Syntax
OvertureComponent2D
-
core
Summary
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
- _drawOverture
- compute
- destroy
- disable
- enable
- getTargeted
- initialize
- onAddOverture
- onAddOvertureDragStart
- onAddOvertureEnd
- onAddOvertureLeaveZone
- onAddOvertureUpdate
- onContextChanged
- onContextMenu
- onContextMenuPropertyChanged
- onContextMenuRemove
- onDoubleClick
- onDragEnd
- onDraggingMove
- onDraggingResize
- onDragStart
- onHover
- onLeave
- onSelectionDynamicDraw
- onStaticDraw
- startListening
- stopListening
- update
Methods
_drawOverture
Syntax
_drawOverture
-
ctx
-
translation
-
zoom
-
data
Summary
Draws an overture.
compute
Syntax
compute
()
Summary
Checks that overtures are well parented with their parent wall.
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddisable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentgetTargeted
Syntax
Summary
Tests if the cursor is on one of the overtures element, and if so returns it.
Parameters:
-
vector
BABYLON.Vector2The vector representing the coordinates of the cursor.
Returns:
The target or null if nothing is under the cursor.
initialize
Syntax
initialize
()
Summary
Initializes the overture menu.
onAddOverture
Syntax
onAddOverture
-
event
Summary
Adds an overture.
Triggered on event wnp.engine2d.onAddOverture
Parameters:
-
event
EventThe event received with the basic overture parameters.
onAddOvertureDragStart
Syntax
onAddOvertureDragStart
-
event
-
target
-
mstate
-
data
Summary
Called when dragging an added overture.
onAddOvertureEnd
Syntax
onAddOvertureEnd
-
event
-
target
-
mstate
-
data
Summary
Called when the action to add an overture is done.
Triggered on wnp.engine2d.onAddOvertureEnd
onAddOvertureLeaveZone
Syntax
onAddOvertureLeaveZone
-
event
-
data
Summary
Unregisters the pointer events when the action to add an overture is done and the cursor leaves the zone.
Parameters:
-
event
EventThe event caught.
-
data
ObjectImportant data used for drawing.
onAddOvertureUpdate
Syntax
onAddOvertureUpdate
-
event
-
target
-
mstate
-
data
Summary
Called when updating an added overture.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context
onContextMenu
Syntax
onContextMenu
-
event
-
target
-
mstate
-
data
Summary
Handles all the items of the context menu.
Triggered on event OvertureComponent2D.context-menu
Parameters:
-
event
EventThe event caught.
-
target
OvertureStructureThe overture structure hovered by the mouse.
-
mstate
ObjectThe current state of the pointer.
-
data
ObjectImportant data used for drawing (null).
onContextMenuPropertyChanged
Syntax
onContextMenuPropertyChanged
-
event
-
property
-
value
Summary
Called when the value of a context menu property is changed.
onContextMenuRemove
Syntax
onContextMenuRemove
-
target
Summary
Called when the user removes the context menu.
Parameters:
-
target
OvertureStructureThe overture structure concerned.
onDoubleClick
Syntax
onDoubleClick
-
event
-
target
-
mstate
-
data
Summary
Duplicates an overture on double click.
Triggered on event OvertureComponent2D.double-click
onDragEnd
Syntax
onDragEnd
-
event
-
target
-
mstate
-
data
Summary
When the dragging ends.
onDraggingMove
Syntax
Summary
When an overture is moved by dragging the cursor.
Parameters:
Returns:
false
onDraggingResize
Syntax
Summary
When an overture is resized by dragging the cursor.
Parameters:
Returns:
false
onDragStart
Syntax
Summary
Handles the movement and reshaping of the overture.
Triggered on event OvertureComponent2D.drag-start
Parameters:
-
event
EventThe event caught.
-
target
OvertureStructureThe overture structure dragged.
-
mstate
ObjectThe current state of the pointer.
-
data
ObjectImportant data used for drawing.
Returns:
false
onHover
Syntax
onHover
-
event
-
target
-
mstate
-
data
Summary
When an overture is hovered by the mouse.
Triggered on event OvertureComponent2D.hover
onLeave
Syntax
onLeave
-
event
-
target
-
mstate
-
data
Summary
When an overture is leaved by the mouse.
Triggered on event OvertureComponent2D.leave
onSelectionDynamicDraw
Syntax
onSelectionDynamicDraw
-
ctx
-
translation
-
zoom
-
data
Summary
Dynamic draw.
onStaticDraw
Syntax
onStaticDraw
-
ctx
-
translation
-
zoom
-
data
Summary
Static draw.
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.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.engine2d.onAddOverture
Syntax
wnp.engine2d.onAddOverture
Summary
Fired when the action to add an overture is started.
wnp.engine2d.onAddOvertureEnd
Syntax
wnp.engine2d.onAddOvertureEnd
Summary
Fired when the action to add an overture is done.