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 / AGK custom text appears as white boxes

Author
Message
GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 16th Jun 2014 18:19 Edited at: 16th Jun 2014 18:20
Hi,

I am new to AGK. I am trying to get a custom font for a text item working but the font is appearing as white boxes whatever I do. I am following the example and help instructions to the letter, but I have the feeling they leave out a crucial step.

I have a PNG image which is just a strip of number characters, this is in the media folder and called numbers.png. I have a text file called "numbers subimages.txt" in the same directory. It contains the following, defining characters 24 pixels wide by 28 pixels high. This file contains:

48:0:0:24:28
49:24:0:24:28
50:48:0:24:28
51:72:0:24:28
52:96:0:24:28
53:120:0:24:28
54:144:0:24:28
55:168:0:24:28
56:192:0:24:28
57:216:0:24:28

No dice.

I have tried - a PNG with transparent background and black characters, a PNG with white background and black characters, a PNG with white characters and black background, a PNG defined as greyscale and as RGB. No dice.

Does anyone know how to do this successfully?

GrumpyOne - the natural state of the programmer

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Jun 2014 19:09
hmm, can u attach a working example of your problem as zip?

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 16th Jun 2014 20:38
Here you go, this is about as simple as it gets



GrumpyOne - the natural state of the programmer

Attachments

Login to view attachments
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 16th Jun 2014 23:20 Edited at: 16th Jun 2014 23:21
In older versions of AppGameKit (including the trial version) you must start your text subimages file with index '32' even if you don't use that character (space). Change your subimages file to:



Then recompile and it should be fine. You also should ALWAYS use white text on transparent background so that the text colors can be changed via SetTextColor() and SetTextCharColor().
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Jun 2014 00:48 Edited at: 17th Jun 2014 01:32
ahh,ok, if u bought agk please start min. with version 108 19.

your example was black on black but this work without char 32 at first in subimages text.


also a great free font tool for agk is this
http://www.warriorsofthecucumber.com/applications/bitmapfontcreator/

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
GrumpyOne
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: London, UK
Posted: 20th Jun 2014 15:25
Yes, I am (for now) using the trial. Want to see how well AppGameKit performs, and so far I am impressed.

Indeed adding 32:0:0:0 makes custom text work on the trial version. Thanks for the advice.

GrumpyOne - the natural state of the programmer

Login to post a reply

Server time is: 2024-11-25 06:28:59
Your offset time is: 2024-11-25 06:28:59