StairwayComponent2D
Summary
Stairway Component 2D.
Constructor
StairwayComponent2D
Syntax
StairwayComponent2D
-
core
Summary
Parameters:
-
core
wnp.CoreWanaplan.
Item Index
Methods
- destroy
- disable
- draw
- drawTargetSpiral
- drawTargetSpiral
- enable
- finalizeTmpStairway
- getTargeted
- initialize
- onAddStairway
- onAddStairwayClick
- onContextChanged
- onContextMenu
- onContextMenuPropertyChanged
- onContextMenuRemove
- onDoubleClick
- onDragEnd
- onDragStair
- onDragStairSpiral
- onDragStart
- onDrawDragging
- onDrawDragStart
- onDynamicDraw
- onFloorAdded
- onHover
- onHoverStair
- onHoverStairMouseMove
- onLeave
- onMouseMove
- onMouseMove
- onStaticDraw
- onStructureLoaded
- startListening
- stopListening
- update
Events
Methods
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddisable
Syntax
disable
()
Summary
Disables the componentdraw
Syntax
draw
-
stairway
-
ctx
-
translation
-
zoom
-
tmpPoint
Summary
Draws a stairway.
Parameters:
-
stairway
StairwayStructureThe stairway structure.
-
ctx
CanvasRenderingContext2DContext 2D of the canvas.
-
translation
BABYLON.Vector2The translation on the canvas.
-
zoom
NumberThe current zoom of the canvas.
-
tmpPoint
BABYLON.Vector2The tamporary point.
drawTargetSpiral
Syntax
drawTargetSpiral
-
stairway
-
ctx
-
translation
-
zoom
Summary
Draw a stairway.
Parameters:
-
stairway
StairwayStructureThe stairway structure.
-
ctx
CanvasRenderingContext2DContext 2D of the canvas.
-
translation
BABYLON.Vector2The translation on the canvas.
-
zoom
NumberThe current zoom of the canvas.
drawTargetSpiral
Syntax
drawTargetSpiral
-
stairway
-
ctx
-
translation
-
zoom
Summary
Draw a spiral stairway.
Parameters:
-
stairway
StairwayStructureThe stairway structure.
-
ctx
CanvasRenderingContext2DContext 2D of the canvas.
-
translation
BABYLON.Vector2The translation on the canvas.
-
zoom
NumberThe current zoom of the canvas.
enable
Syntax
enable
()
Summary
Enables the componentfinalizeTmpStairway
Syntax
finalizeTmpStairway
()
private
Summary
Finalizes to build the stairway, and creates the hopper.
getTargeted
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:
The targeted element, or null if nothing is found.
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.onAddStairway
Syntax
onAddStairway
-
event
Summary
Add a stairway.
Parameters:
-
event
EventThe event receive with the basics data.
onAddStairwayClick
Syntax
onAddStairwayClick
-
event
-
target
-
mstate
-
data
Summary
When the user add a point on the stairway with a simple click.
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
Handle all the item of the context menu.
onContextMenuPropertyChanged
Syntax
onContextMenuPropertyChanged
-
event
-
target
-
value
Summary
When a value is changed.
Parameters:
-
event
EventThe event catch.
-
target
StairwayStructureThe stairway structure changed value.
-
value
Number | StringThe changed value.
onContextMenuRemove
Syntax
onContextMenuRemove
-
target
Summary
When the user remove the context menu.
Parameters:
-
target
StairwayStructureThe subslope overture structure changed value.
onDoubleClick
Syntax
onDoubleClick
-
event
-
target
-
mstate
-
data
Summary
When the user double-clicks on the stairway, adds a new point.
onDragEnd
Syntax
onDragEnd
-
event
-
target
-
mstate
-
data
Summary
When the user finish to drag the stairway.
onDragStair
Syntax
onDragStair
-
event
-
target
-
mstate
-
data
Summary
When the user drag a spiral stair.
onDragStairSpiral
Syntax
onDragStairSpiral
-
event
-
target
-
mstate
-
data
Summary
When the user drag a spiral stair.
onDragStart
Syntax
onDragStart
-
event
-
target
-
mstate
-
data
Summary
When the user start to drag the stair.
onDrawDragging
Syntax
onDrawDragging
-
event
-
target
-
mstate
-
data
Summary
Draws the stair when the user drag the stairway.
onDrawDragStart
Syntax
onDrawDragStart
-
event
-
target
-
mstate
-
data
Summary
Method call only on the drag start when the user draw, it allow to simulate a pen to draw the stairway.
onDynamicDraw
Syntax
onDynamicDraw
-
ctx
-
translation
-
zoom
-
data
Summary
Dynamic draw.
onFloorAdded
Syntax
onFloorAdded
-
event
Summary
When the user adds a floor, the engine looks for the stairway in floor below and computes the hopper.
Parameters:
-
event
EventThe associated event.
onHover
Syntax
onHover
-
event
-
target
-
mstate
-
data
Summary
When hover.
onHoverStair
Syntax
onHoverStair
-
ctx
-
translation
-
zoom
-
data
Summary
When the user hovers the stairway.
onHoverStairMouseMove
Syntax
onHoverStairMouseMove
-
event
-
target
-
mstate
-
data
Summary
When the user hover the stairway with the cursor.
onMouseMove
Syntax
onMouseMove
-
event
-
target
-
mstate
-
data
Summary
On the mousemove, in draw state, we create the temporary point (perpendicular to the last segment).
onMouseMove
Syntax
onMouseMove
-
origin
-
stairway
Summary
Add the magnetism on the stairway.
Parameters:
-
origin
BABYLON.Vector2The origin of the point.
-
stairway
BABYLON.stairwayStructureThe stairway structure.
onStaticDraw
Syntax
onStaticDraw
-
ctx
-
translation
-
zoom
-
data
Summary
Static draw.
onStructureLoaded
Syntax
onStructureLoaded
()
private
Summary
When the structure is loaded, we check the coherency of the structure.