question about sprites

Blitz3D Forums/Blitz3D Beginners Area/question about sprites

The problem with texture buffers is that it works on a 1 to many relationship with the surfaces that use it. Therefore if you use 1 texture buffer for many surfaces, then when you edit that texture buffer all surfaces will show the changes. The ONLY way around this afaik is to create a seperate texture buffer for each instance.

However in your case you wouldn't necessarily need to load all the imagery as textures. You could create an arbitrary number of texture buffers for the predicted amount of cards you require on screen at one time. Then assemble the pieces of each card, i.e. paste each part onto the buffer where required to make the final image.

So to do this, I presume a little detail would help, you would do the following:

1. create a texture buffer
2. load in your background layer and paste it onto the texture buffer
3. load in your picture layer and paste it over the background already on the texture buffer
4. paste your 4-section layer over the rest

You could create a function that takes the texture buffer, and filenames (or lookup data depending on how you work best) for each component and then it draws the card onto the texture buffer.

The relevant commands you'll need will be:

CreateTexture, TextureBuffer, DrawImage and maybe MaskImage.

If you need any further help, i.e. with specifics then do ask, however you'll learn more from reading the command help and working out the details yourself. Give it a go and post back if you get stuck.