CrowdSimApp Class
Item Index
Methods
- addEntity
- clear
- createEntityEnd
- createEntityStart
- cycleDetail
- destroyEntity
- editEntity
- entityClick
- getCreatingEntity
- getEngineSettings
- getSelectedEntity
- getStats
- init
- isRunning
- listExamples
- load
- loadExample
- mousedown
- mousedown
- mousemove
- mousemove
- mouseout
- mouseover
- mouseup
- mouseup
- mousewheel
- onCreateAgents
- onCreateEntity
- onDestroyAgents
- onDestroyEntity
- onStop
- pan
- reset
- resize
- run
- save
- screenToWorld
- selectEntity
- selectEntityById
- step
- stop
- toggleRun
- worldToScreen
- zoom
Methods
clear
()
Clear current world.
createEntityStart
(
Render.Entity
-
entityType -
pos
Request to create an entity at a give pos.
Parameters:
-
entityTypeEntityTypes -
posVec2
Returns:
Render.Entity:
cycleDetail
(
-
entityType
Cycle an entity detail level.
Parameters:
-
entityTypeEntityTypes
destroyEntity
(
-
entity
Destroy an entity.
Parameters:
-
entityRender.Entity
editEntity
(
-
entity
Edit an entity starting is creation mode.
Parameters:
-
entityRender.Entity
entityClick
(
-
pos -
newEntity -
selected
Stage entity click event, creation of new entities.
Parameters:
-
posVec2 -
newEntityRender.Entity -
selectedRender.Entity
getCreatingEntity
()
Render.Entity
Request current entity creation of null if finished
Returns:
Render.Entity:
getSelectedEntity
()
Render.Entity
Gets the current selected entity.
Returns:
Render.Entity:
init
(
-
canvas -
options
Inicialization of application.
Parameters:
-
canvasCanvasto render scene.
-
optionsObject
load
(
-
loader -
loadDefault
Load a world.
resize
(
-
window -
width -
height
Resizes the scene.
save
(
String
-
save
Save current world.
Parameters:
-
saveBooleantrue to save; false to return String
Returns:
String:
raw
screenToWorld
(
Vec2
-
x -
y
Convert screen to world coordinates.
Returns:
Vec2:
world coordinates
selectEntity
(
-
entity
Sets the current selected entitiy.
Parameters:
-
entityRender.Entity
worldToScreen
(
Vec2
-
x -
y
Convert world toscreen coordinates.
Returns:
Vec2:
screen coordinates
