Beginner's Question - Scrolling large BMP

Previous topic - Next topic

shmuppet

Hi, I'm interested in writing a vertical scrolling shoot 'em up.  My plan of action to learn GLBasic with this project was to get a background scrolling first and foremost, and thought of simply having a large (long) static image scrolling to make things easy -  I've got some limited experience with BASIC, but not games programming so tile maps are scary to me!  Besides, I'm no artist so didn't want to spend ages trying to draw tiles when I can knock-up a test background in 2 minutes if it's in one chunk.

I've tried to load a large bmp/png as a sprite (320 x 7680) and then scrolling that by changing the vertical every frame, but I don't seem to be able to get the entire image to display.  Is there a limitation on the height of sprites?  Is there another way of going about what I want to achieve that would be better?  Thanks!

doimus

GLBasic uses graphic card video memory for storing graphics, so pixel size is limited by the card's maximum texture size. Most modern cards support up to 7000 or 8000px textures or even more, but then again, most older cards don't.

But it would be kind of ridiculous to make an 320x240 game that runs only on the most powerful cards, wouldn't it?
Your best bet and fastest solution is to chop that image into smaller slices, probably at 1024x320.

Then just draw first (top-most) slice at y=0, then second at y=1024 then 2048, etc.  and GLB will take care of efficient drawing.

matchy

In terms on "chunks", they are "tiles" but in this sense they are sliced. So the idea would to cut up the 320x7680 in to 24 separate 320x320 sprites. Then you only need to display 2 sprites at a time as they move along.

mentalthink

Hi smuppet, I think the best thing waht you can do, I do in some cases, i get this image, is HUge, I thnk in example, on WIZ don´t works.

Take your image and divide in parts, ex: if you have 7000px, and your screen have 240 of heigth, divide, your image/240 px.

And adter you can do, in exple load 2 images, and when the 3rd into the screeen, divide the first, when into the 5th image delete from memory the 3rd.

It´s easy, in principle can be complicated, but you only use a few comands, not is complicated, is need help , comment me.

Kind Regards,
Iván J.

shmuppet

Thanks for all your help guys, I got it working by breaking the image up into chunks as you said :)