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.

AppGameKit Classic Chat / [Tier 2] SetTextFontImage possible with Memblock created image ?

Author
Message
Klomy
9
Years of Service
User Offline
Joined: 17th May 2014
Location:
Posted: 24th Jul 2014 01:41
Working with tier 2 AppGameKit, I'm trying to set up a custom font. I do know I need to have my "custom.png" as well as a text file named "custom subimages.txt". I assume when I call LoadImage, it keeps somewhere the image file name so when I create the font, it knows which .txt to look for. That works fine.

But what happen when I load the image with CreateImageFromMemblock ? I can't figure out how to specify the subimages data. Can it be done ? Or do I really need to load the image with LoadImage in this specific case ?

Right now I do something like create temporary files with my data, load the image from the file, create the font, and destroy the temporary files. It works ok, but if I could do it all from memory, that would be great
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 25th Jul 2014 07:38 Edited at: 25th Jul 2014 07:42
If you can work with fixed size fonts then you don't need subimages file.

The absence of the subimages file forces AppGameKit to assume;
- the image is exactly 16 x 6 characters with no borders
- each character is exactly 1/16th of the width of the image
- each character is exactly 1/6th of the height of the image
- characters are in the standard order used for AppGameKit font sets

If you can work with this, then you can do it from memory, if not then you're probably doing it the best way already.

Edit:
One plus is that since the power of 2 image size recommendation is mainly for compatibility when loading, it doesn't apply in this case.

Login to post a reply

Server time is: 2024-04-18 05:46:53
Your offset time is: 2024-04-18 05:46:53