Game Development Community

Repeating image for streched sprite possible?

by Johan Stenqvist (neochrome) · in Torque Game Builder · 09/19/2005 (3:20 am) · 4 replies

Hi everybody,

Does anyone know if T2D currently supports repeating of an image when stretching a sprite?
If, for example, you have an imagemap of a brickwall properly aligned you could define a sprite of size "10 5" and another of "20 5" and still use the same imagemap without getting a strecthed brickwall, but instead have it repeated over the x-axis.

I think it might be possible to use a fxChunckedSprite2D or fxScroller2D, but they both seem to use only whole images and not KEYed or CELLed ones.

Any thoughts?

Regards,
Johan

#1
09/19/2005 (5:03 am)
To keep things fast, the only texture repeating that T2D currently uses is hardware wrapping of textures that unfortunately requires the use of the whole texture. Anything else would require repeating the rendering in software whilst not a difficult thing to do, does slow things down a little.

Directly, it's not a standard feature outside of using full mode for your imageMap but it's easy to adapt a special version of either the static or animated sprite to do this as it only requires adding the parameters to specify the number of repetitions and the minor rendering-code change.

- Melv.
#2
09/19/2005 (5:06 am)
Thanx for your reply Melv,

I think I'll stick to use a separate texture for this - sounds like to easiest way to go.

Cheers,
Johan
#3
09/19/2005 (8:57 am)
What about using a tiny tilemap layer? I'm pretty sure you could create a "10 5" tilemap, and assing the same image to each tile using TS.
#4
09/19/2005 (11:24 pm)
Yeah, that might work...If I create the tilemap with more tiles than I actually need, I should be able to scale the tilemap and get the effect I want...or why not just pu one tile in there and enable wrapping?? Great suggestion - I'll have to try this out!

Cheers,
Johan