WallComponent2D
Summary
2D Wall management.
Constructor
WallComponent2D
Syntax
WallComponent2D
()
Summary
Item Index
Methods
Properties
- _COLORS static
- _PATTERN_IMGS
- _PATTERNS
- displayMesure
- name
- priority
- structure
- TYPE_GARDEN static
- TYPE_NORMAL static
- TYPE_SEPARATOR static
- TYPE_TERRACE static
Methods
_addWallFirstPoint
Syntax
_addWallFirstPoint
-
mstate
-
[point]
Summary
Adds a the first point in the wall.
Parameters:
-
mstate
ObjectState of the mouse.
-
[point]
PointStructure optionalpoint 0 of the wall.
_addWallUpdate.
Syntax
_addWallUpdate.
-
mstate
Summary
Add the second point and insert the wall in the structure.
Parameters:
-
mstate
ObjectState of the mouse.
_addWallUpdate.
Syntax
_addWallUpdate.
-
mstate
Summary
Updates the wall temporary.
Parameters:
-
mstate
ObjectThe state of the mouse.
_drawMeasures
Syntax
_drawMeasures
-
ctx
-
translation
-
zoom
Summary
Draws all measures.
Parameters:
-
ctx
CanvasRenderingContext2DCanvas 2D context.
-
translation
BABYLON.Vector2Canvas 2D translation.
-
zoom
NumberCanvas 2D zoom.
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddisable
Syntax
disable
()
Summary
Disables the componentdrawWall
Syntax
drawWall
-
ctx
-
translation
-
zoom
-
wall
-
[options]
Summary
Draws a wall.
Parameters:
-
ctx
CanvasRenderingContext2DCanvas 2D context.
-
translation
BABYLON.Vector2Canvas 2D translation.
-
zoom
NumberCanvas 2D zoom.
-
wall
WallStructureInvolved wall.
-
[options]
Object optionalDrawing options.
enable
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:
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.onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context
simplifyWalls
Syntax
simplifyWalls
()
private
Summary
Deletes small walls.
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
_COLORS
Syntax
Summary
Constants for the colors of the wall.
Default: ["#333333", "#616161", "#BEBEBE", "#EEEEEE", "#339900"]
_PATTERN_IMGS
Syntax
_PATTERN_IMGS
Image
Summary
Images for drawing style of the walls.
This is an array of Image.
You can then change the style of the wall in the function drawWall
using
options.styleId
where styleId is the index of the style in this Array.
_PATTERNS
Syntax
_PATTERNS
CtxPattern
Summary
Drawing patterns for drawing style of the walls.
This is an array of drawing patterns (see canvas patterns).
You can then change the style of the wall in the function drawWall
using
options.styleId
where styleId is the index of the style in this Array.
NB : use function
createPattern
of a 2D context. For theImage
parameter, use the image inPATTERN_IMGS
at the same index.
Default: "repeat"
displayMesure
Syntax
displayMesure
Boolean
Summary
Flag that enables/disables the displaying of measures.
Default: true
priority
Syntax
Summary
Priority of the component for update callbacks.
Default: 10
structure
Syntax
structure
wnp.Structure
Summary
Structure file instance (shortcut to wanaplan.structure). This is the base object where the whole plan is savedTYPE_SEPARATOR
Syntax
Summary
Constant for separator walls.