Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Composing many sprites into one sprite?

Author
Message
Manische witz
16
Years of Service
User Offline
Joined: 3rd Jul 2008
Location:
Posted: 4th Jul 2008 04:08
I have some comic style text balloons which I would like to move around onscreen. Each tick, I dbMoveSprite each letter and the balloon upward by a few pixels until it is in place. Then, once the user advances the text, the balloon moves up and off the screen.

The problem is, if I have too many letters on screen at once, I get slowdown. This is only an issue with 150+ letters or more, so if I break down the text balloons into smaller phrases and show them in sequence, it works fine. Not really a great solution, though, as I'd like to be able to put lots of text in a single balloon depending on the situation.

So, instead, I thought when a new balloon is being spawned, I might be able to compose the balloon and text into a single sprite. Then, I would just scroll that one sprite. Then I'd just have one slow frame during composition.


As I understand it, I can dbCreateBitmap, draw the sprites on it, and then dbGetImage the result, slap that on a sprite, then switch back to the screen for drawing. This works, but 1.)I lose my transparency during the process, and 2.) All the other sprites I'm drawing get drawn on the invisible bitmap too. All the workarounds I've tried end up being slower than the original method.

Is there a way to put together the sprites or otherwise composite text onto the bubble without using this alternate bitmap method? Perhaps some tricky options on the drawtext functions? Make memblocks and just drop the text sprite data onto the memblock in the correct position?

Thanks in advance.

Login to post a reply

Server time is: 2024-09-30 01:27:43
Your offset time is: 2024-09-30 01:27:43