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 / about custom text font, how to use SetTextFontImage ?

Author
Message
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 25th Oct 2011 15:14 Edited at: 25th Oct 2011 15:19
"The AppGameKit will look for images 32.png up to and including 127.png in the subimages file and any not found will default to the space character (32.png)."

I tried many times to use my own text font . but all failed ,

I only need to use numbers in my game , so I rename the number images with 48.png 49.png - 57.png.

then I use Imagejoiner.exe to join them together.there is no other image,such as letters.

then I use SetTextFontImage() to load my own Text font. but I can't make success.

anyone can give me a hand ?

give my best
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 26th Oct 2011 09:43
why no one answer this question?
is it very difficult to answer?

give my best
Hubdule
22
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 26th Oct 2011 10:16 Edited at: 26th Oct 2011 10:17
Why not using this: http://forum.thegamecreators.com/?m=forum_view&t=189225&b=41

+ this code:



Then you don't need to use seperate image files for the numbers.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Oct 2011 11:29
If you only need the numbers just load the images using "loadSubImage" and manually use the number sprites when needed. Then you don't need to load a whole font just for the numbers?

halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 26th Oct 2011 12:22
player parameter
12
24
23
12

or score board
223
123
125

baxslash,need I crate many sprite for numbers?

give my best
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Oct 2011 12:50
Quote: "baxslash,need I crate many sprite for numbers?"

Well you'll need to create one sprite for each number but you could create a number "Type" that saves the sprites for an integer so you could then keep track of 'sets' of sprites. I would store the data as follows:

IE.


...or you could create a string from the list of sprite numbers and parse the string when you need to move / edit / delete the set.

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 26th Oct 2011 17:32
There was a correction to the documentation recently, it will actually look for images named "32" to "127" without the ".png" on the end, also 32 must always exist, even if it is just blank.
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 26th Oct 2011 20:43
Paul,thank you very much.
I am puzzling these days.

give my best
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 26th Oct 2011 21:23
it works. thank you. I just finished some code.

give my best

Login to post a reply

Server time is: 2024-11-25 14:10:58
Your offset time is: 2024-11-25 14:10:58