/
Scene
Scene
User Interaction
The Scene captures keyboard and mouse events by default and sends them to entities that are underneath the mouse when the event happens
click
doubleClick
middleClick
middleMouseDown
middleMouseUp
mouseDown
mouseMove
mouseOut
mouseOver
mouseUp
rightClick
rightMouseDown
rightMouseUp
To have an entities receive these events anywhere add the 'captureSceneEvents' component to any entity.
On platforms using a touch interface, the events that are sent will be limited to those supported by platform.
Scene Config
{ "map":"config/map/main.json" //initial map to load. Can be file name or map config. ,"cameras":[ //optional - define cameras (if you don't specify this key one will be generated automatically) { width:100 ,height:100 ,name:"main" } ] ,"entityPools":[ //optional - array of pools to create. each pool contains the entity config file name, //and amount of copies to initially spawn {"entityFile": "config/entities/powerShot.json", "amount":20} ] ,"sounds":[ //optional - list of sounds files to pre-load "assets/sounds/SciFiMediumExplosion.wav" ] ,"components":[ //optional - Array of scene component configs to load { "type":"pixelblit.bunnyblast.BunnyblastSceneComponent" } ] ,"worlds":{ //optional - world configs for each world type used. This example sets gravity on the box2d world. box2d:{ gravity:{ "x":0, "y":5} } } }
, multiple selections available,