Suggestions for scroll unravelling?

BlitzMax Forums/BlitzMax Programming/Suggestions for scroll unravelling?

Grey Alien(Posted 2006) [#1]
Hi, I've got a scroll graphic in three parts. The main sheet of paper, and a top and bottom "roll" bit.

I made it animate so that the rolls start together in the middle and roll up and down exposing the middle sheet of paper. To get the paper to draw I was gonna use viewports but then remembered all that stuff about them maybe not being supported on all cards so I used a DrawImageArea function by Ian Duff which seems to do the job using DX or OpenGL ImageFrames.

Anyway, all that is fine, BUT I want to put some writing on the scroll, so that you can see it as the scroll unravels. Well, the writing is game stats so it needs to be dynamic, it can't be done in a paint package. I see I have two choices ...

a) Set a viewport (that scales as the scroll unravels) and then draw the text. Problem with this is if viewport is not reliable on all cards, some people may see all the text all the time...unless the whole viewport being unreliable is bull info. Anyone know?

b) Draw the text on the scroll sheet image by clearing the screen, drawing the scroll sheet then the text. Then I can grab the scroll sheet back into the image and use that with the DrawImageArea function, no viewports needed. Problem is this: the scroll sheet is a 32bit png so it has an 8 bit alpha channel for the rough edges. When I regrab it, it won't grab any alpha info, it'll just have black edges, so when I redraw it, it'll look crap :-(

c) use some render to texture fancy sh*t.

So I'm stuck. Anyone got any cool ideas?

Thanks :-)


tonyg(Posted 2006) [#2]
Write an example for A), try it out yourself and post it here for people to try.
<Edit> Or use setuv to draw a portion of the text.


Grey Alien(Posted 2006) [#3]
Oh yeah OK. Just any simple example using viewport would do, doesn't need to be my scroll. Does anyone have any experience of viewports failing?

OK teste code posted here:

http://www.blitzbasic.com/Community/posts.php?topic=62781