Vertical bitmap scroller - realtime
BlitzPlus Forums/BlitzPlus Programming/Vertical bitmap scroller - realtime
| ||
@all, On the amiga I usually made a vertical scroller by showing a bitmap image "outside" the window barrier at the bottom, and then scrolled the entire screen upwards. This was easy because you could setup a bitmap larger than what was visible. But how bout' BlitzPlus? how do you best write a vertical smoothe scroller (vertical) ... can you print bitmap images "out-of-sight" without messing up memory and cause crashes? |
| ||
Create a window and then a canvas that is larger than the window. Then just move the Canvas by using SetGagdetShape to move it around. Same technique as the Amiga really. Hope that helps Regards |
| ||
@prof it helps then again no I do not use Windows, but fullscreen in BlitzPlus |
| ||
Viewport x, y, width, height |
| ||
@Prof thought so :-D |
| ||
When you say scroller, do you mean text or images, and if images are they tiled ? |
| ||
Bitmap text @Zawran |
| ||
You shouldn't have to scroll the entire screen, blitz should be able to draw lines with the text fast enough and then you can just make a system of lines moving up and as the top line moves outside the screen area; move it down to the bottom and give it a new line of text to draw. I have used something like that a number of times and it seems fast enough. Otherwise if you want to scroll the entire screen then make a buffer that is as big as the screen plus one row extra on the bottom. Draw the current line into that row that is out of sight and each frame use copyrect/block to scroll the entire buffer and once you have scrolled enough draw a new line on the bottom. I hope the above made sence ;-) |
| ||
His du ser på www.blitzbasic.no så finner du et par bitmap-scrollere der, med source. Det er lenge siden jeg lagde dem men prinsippet er det samme. Jeg bruker types og gir hver type en bitmap og en teller for horisontal og vertikal posisjon. Så lar jeg bokstavene dukke opp utenfor skjermen på høyre side og flytter dem ved å telle ned posisjonen og når de er ute av skjermen på motsatt side kan de bare deletes. Akkurat på samme måte som med sprites på Amiga og C64 men siden PC'er har software-sprites er det helt fritt hva slags størrelse de har eller hvor mange det er av dem. |
| ||
@Wedeo Takk, jeg skal checke dine samples ... :-D |