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 / Text from charset image.

Author
Message
s_i
15
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 7th Aug 2011 21:02
I have image with charset (for example like in uploaded image), and file with data (coordinates of every letter or symbol). How can I use it for writing text? What DarkGDK commands I need to use for this? Maybe, some code?.. Thanks!

Attachments

Login to view attachments
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 7th Aug 2011 21:47
Dark Invaders tutorial that comes with DarkGDK has an example of using sprite text (exactly like your case)

s_i
15
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 9th Aug 2011 11:41
No, Dark Invaders uses sprite for EVERY letter. I have big pieces of text, and so it will be hundreds of sprites. Maybe it will be too long.
Other ideas?
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 9th Aug 2011 15:44 Edited at: 9th Aug 2011 15:48
Maybe you can break it up into one image per letter (with dbGetImage) and then use dbPasteImage to put the letter images onto the screen.

EDIT: Breaking up is necessary because dbPasteImage does not have area parameters to copy only part of an image.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 9th Aug 2011 15:51 Edited at: 9th Aug 2011 15:53
To be even clearer, you would load the image as a bitmap (dbLoadBitmap), then dbSetCurrentBitmap to the loaded image, then dbGetImage in a loop until you get image numbers for all letters. Then the original image is no longer needed and you can use dbPasteImage with the numbers of the separated letter images. (You probably need to set the current bitmap back to the screen - zero - after the images are done.)
s_i
15
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 9th Aug 2011 21:23
Thanks, Mireben, it is a good decision for me.

Login to post a reply

Server time is: 2024-11-19 08:47:43
Your offset time is: 2024-11-19 08:47:43