TileImage Question

Blitz3D Forums/Blitz3D Beginners Area/TileImage Question

Crazy4Code(Posted 2006) [#1]
I'm back from doing C++ for a while, but I miss the ease of Blitz. But anyways, (and this is a 2D question and probably a really stupid one) I need an image of the ground to be tiled, but only 1 row at the bottom of the screen. I could use TileImage, but then it would fill the whole screen with the image of the ground and I only want it tiled at the bottom. I don't know if I explained that very well, but how could I do this? I'm sure i'd find it if I read through the commands.


big10p(Posted 2006) [#2]
Just stick your DrawImage/DrawBlock inside a loop to iterate the tile across the screen. I don't think there's a specific command to do this for you, unless you define a viewport and then use TileImage - I wouldn't recommend that, though. :)


Crazy4Code(Posted 2006) [#3]
Well, it's just that I need it to be able to move, but never have empty space.


big10p(Posted 2006) [#4]
Oh, I see; then using a viewport may not be such a bad idea, after all. :) You can then make the tiles move/scroll by setting the render x/y coords with the Origin command.


tonyg(Posted 2006) [#5]
Can't you change the tileimage x/y parms to start at x=0, y=graphicsheight()-imageheight(tileimage)?


big10p(Posted 2006) [#6]
You're right, tonyg. Dunno what I was thinking. :)