Sprite usage [resolved]

sign up sign in

I've been playing around with Luxe and I came across something relatively simple.
I'm wondering about how I'm suposed to deal with Sprites.

Let's say that I want to create a Pool of Sprites.

var spritesPool : Pool<Sprite>;

Somewhere else I have

spritePool = new Pool<Sprite>(10, create_sprite);

createSprite being the callback for creating the objects

function create_sprite(index:Int, length:Int) : Sprite {  
    return new Sprite({...}); //the "..." is for simplification
}

The point is that wherever I create a Sprite it is drawn in the screen. I don't want it to happen, because I'm storing a list of Sprites to use when needed, not immediately.

In luxe.Visual I can see where it is added to the default batcher. If I set SpriteOptions.no_batcher_add to true it is no long visible as it is not configured to be rendered (right?).

The question is: should I just set the SpriteOptions.visible to false or is there a better way that I'm overlooking?

Tags
helpluxe