change textures coordinates

Started by Gatobot14, January 23, 2016, 02:49:35 PM

Previous topic - Next topic

Gatobot14

Its posible for an animated object (bones object) to use setTextureMatrix???

EgonOlsen


Gatobot14

Docs says that works better on compiled objects and i dont know if bones objects are compiled, and after reading this ,
its good practice to use compiled objects? what are the benefits, or limitations?? i only call build

EgonOlsen

The wiki has a section on compiled objects. Basically, it's a good idea to use them, because they are much faster in most cases. If using them on animated objects, you have to make sure to compile them in dynamic mode and for Bones, you have to call touch() on an animated object after applying an animation, because otherwise, it won't recognize the change.
jPCT-AE always uses compiled objects BTW.

Gatobot14

Ok now setTexturesMatrix only work in stage 0, i have my textures in one texture atlas, if i need to set another texture layer in my object, how can i move textures coordinates for the second layer?

EgonOlsen

If you don't specify anything else, the texture coordinates for the second stage will be the same the ones for the first if you assign a TextureInfo instance with 2 stages.

Gatobot14

But i will be able to move the coordinates for the second layer? Suppose i dont want the second layer be in same position like the first, example: in a texture atlas i have my first texture in first tile and my second texture in the fourth tile, is this possible?

EgonOlsen

...not sure what you mean exactly...!?

Gatobot14

if setTextureMatrix changes coordinates for first layer, how can i change coordinates for second layer?

EgonOlsen

By default, you can't. You would have to use your own custom shader to do that.

Gatobot14

perfect thanks for your patience jeje ::)

EgonOlsen