miércoles, 30 de octubre de 2013

Layers

There are a great algodoo undocumented feature - layer.
To create a layer, use the command
CODE: SELECT ALL
Scene.addLayer {visible: = true; color: = [1, 1, 1, 1]; id: = 2; dynamic: = false};

To put a geom on some layer, you need to specify layer id when you create it:
CODE: SELECT ALL
Scene.addbox {layer: = 2; ...}

or to draw interactively, set active layer by entering command
CODE: SELECT ALL
scene.selectLayer(2)

Changing the properties of the layer can be done via the same command - scene.addLayer
    visibility - to show layer or not
    color - a factor for all the colors in the layer (eg [1,1,1,0.5] will do a translucent
    dynamic - whether physics cheat on this layer, or it just a "picture"

All that could be very handy if you want to make few locations or just a picture with no performance impact and so on.
Last edited by Kilinich on Thu Jan 24, 2013 8:08 am, edited 3 times in total.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 1501
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia


No hay comentarios:

Publicar un comentario