WallComponent2D Class
2D Wall management.
Constructor
WallComponent2D
()
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
-
mstate
-
[point]
Adds a the first point in the wall.
Parameters:
-
mstate
ObjectState of the mouse.
-
[point]
PointStructure optionalpoint 0 of the wall.
_addWallUpdate.
-
mstate
Add the second point and insert the wall in the structure.
Parameters:
-
mstate
ObjectState of the mouse.
_addWallUpdate.
-
mstate
Updates the wall temporary.
Parameters:
-
mstate
ObjectThe state of the mouse.
_drawMeasures
-
ctx
-
translation
-
zoom
Draws all measures.
Parameters:
-
ctx
CanvasRenderingContext2DCanvas 2D context.
-
translation
BABYLON.Vector2Canvas 2D translation.
-
zoom
NumberCanvas 2D zoom.
destroy
()
disable
()
drawWall
-
ctx
-
translation
-
zoom
-
wall
-
[options]
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
()
getTargeted
-
vector
Parameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
()
onContextChanged
-
context
Parameters:
-
context
StringThe new context
simplifyWalls
()
private
Deletes small walls.
startListening
()
stopListening
()
update
()
Properties
_COLORS
Array
final
static
Constants for the colors of the wall.
Default: ["#333333", "#616161", "#BEBEBE", "#EEEEEE", "#339900"]
_PATTERN_IMGS
Image
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
CtxPattern
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"