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 / dbInk() very slow

Author
Message
Schobaer
11
Years of Service
User Offline
Joined: 17th Aug 2012
Location:
Posted: 17th Aug 2012 15:31
Hallo,
I want to scroll textlines with different colours. But if I use dbInk(),dbSetTextFont() or dbSetTextSize() the scrolling slows down. Are these commands so slow?

Thanks for help

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 18th Aug 2012 01:51
Yes they are, those functions are best not used in realtime.
I'd suggest you to look into creating a bitmap font system, with a bit of colour blending you can change colours of those with ease and yes, they run very fast.


"Why do programmers get Halloween and Christmas mixed up?"
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 18th Aug 2012 19:01
Also changing the text font and size will have a huge impact on speed as it has to reload the new font.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Mister Fuzzy
13
Years of Service
User Offline
Joined: 27th Feb 2011
Location: XNA
Posted: 19th Aug 2012 00:09 Edited at: 19th Aug 2012 00:11
A little while ago, I wrote myself a sprite font system (No kerning, but I didn't require one for my purposes...) Here's the code:

And attatched is a bitmap font. Everything's pretty well labeled, so changing the system shouldn't be hard. It runs by reading a string's ASCII codes, and pasting the apropriate letter at a calculated position. Nothing special.

Using this function, you can use multiple font images at no cost to the game's performance, as each font requires only ONE sprite!

It's been fun: So long, TGC!

Attachments

Login to view attachments
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 19th Aug 2012 03:42
you might want to check this out

Login to post a reply

Server time is: 2024-04-19 07:16:32
Your offset time is: 2024-04-19 07:16:32