Hemos añadido un nuevo objeto a CObjectLayer, se trata de una malla genérica. Por lo que, ahora se pueden combinar sprites, textos y mallas genéricas en una misma capa.

Además, una malla puede estar compuesta por submallas, pudiendo asignar diferentes formas de renderizado a cada submalla: Points, Lines, LineStrip, LineLoop, Triangles, TriangleStrip y TriangleFan.

Estas mallas son totalmente editables, pudiendo añadir y modificar en cualquier momento: VertexPosition, VertexColor, VertexTextureCoords, VertexNormal. Por último, decir que el usuario puede añadir VertexIndex si la malla no es lineal.

Como siempre será la propia clase la que se encargue de hacer el trabajo difícil.

Por lo demás, se comportará como un sprite normal y corriente.

Improved layer system

MindShake has improved its layer system.

Until now the layers were little else that an object container, but now you can: 

  • Set the layer position, affecting all the objects inside.
  • Modify layer render order.
  • Scale independently each layer, horizontaly or vertically.
  • Set its pivot, to move each layer snugly and make nice transitions.
  • Modify the layer alpha channel or colorize (tint) it, to make some cool effects.

And, of course, you can still enable camera transformation to leave the system to adjust the layers relative position and scale to do automatic parallax scrolling.

All these changes affect the contents of the layer and you can make some effects more easilly now.

Unified Layers

At beginning we mistakenly thought that was better to separate objects per kind because we thought that this way would be simpler for the users and we wanted to promote the use of layers because we think that is is a powerfull feature.

But now we think that is better, and easiest, allow the user decide how he/she wants to distribute the objects across layers.
In this way we unified SpriteLayer, TextLayer and 3DModelLayer (not available) into ObjectLayer. Thus, the only different layer at this point is TileLayer that is in fact wholly different from other layers.

Layer & Camera System

MindShake includes support to add layers and cameras, with no limits, you can create as many layers and objects inside layers as you want.

MindShake includes managers for layers and cameras which act as factories, so you can easily create new objects. Later, to easy access to these objects, you can store the reference or give them a name, so you can ask the managers to recover one object with its name.

By default all layers created are configured to adjust to camera renders. If the user want to have a serie of static sprites on the screen, the common way is to put them on a layer that is ignored by camera transformations.

To create a usable sprite layer you need one instance of the scene manager and then invoke the method CreateSpriteLayer.
That is done in this way:

With this example you see how to create a new sprite layer and modify it to ignore the cameras, so any sprite created into this layer will be shown relative to the upper left corner of the screen.

With the layer created you can now add one or more cameras to view diferent parts of our world.
When we add a new camera it is important to tell it the size and position of the viewport (the region where the camera content will be seen) and the dimensions of the world (the region where this camera can move).
Now you can see one example of scroll.

If our window have a 320×240 size, with this example you will see a scroll effect when move the camera around the world, because it have double size than camera viewport.

It is easy to create more cameras, you only meed to set the viewports in order to view them correctly, for example you can split the screen with three cameras, two of them at the top and one at the bottom.

Now you can move the cameras with the SetPosition method and every viewport will automatically show the camera content.