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 / Getting Sneaky with AGK Text

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd May 2012 22:47
I've had a need for BIG numbers, and also for the functionality that comes with AppGameKit Text - colouring, resizing, changing characters on the fly, spacing, etc... Unfortunately there are limits on the size of the font image file, and on the resources it would consume to load up almost 100 character images at 256 pixels height each.

Here's the solution for all to share, perfect for in-game scores, speedos, lives etc...Enjoy!

http://www.thegamecreators.com/news/2012/05/innumeracy-made-good/

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 23rd May 2012 23:33
Very usefull
But dont you think this would be easier to convert to agk?
And simply use an animated sprite you draw on screen?
I used it many times in dbp!
If i get the time so will i convert it!
Cheers.
http://www.thegamecreators.com/?m=codebase_view&i=93253c283037893f4956e3b8957bb8b5
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th May 2012 00:12
Animated sprites are okay, but there are a few advantages for my purpose with using text:

1. You can't predict the order of the images using image joiner. I will be using many font styles, so it is easier to spend 2 minutes editing a text file than coding around confusing sprite sheet ordering. The alternative is manually mapping out the Atlas image.

2. I want to use the Text functionality to create strings e.g scores that can be in the thousands.

3. You can use proportional fonts with no extra hassle

4. You can colour the fonts, just use greyscale tinting on the original and it can be coloured instantly. When numbers hit a threshold, you can change from Green to Red

5. Changing a number rapidly is very quick when you are just supplying a string, and the length of the string also becomes irrelevant, it's just one ID to refer to.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th May 2012 16:39
I have spoken to Paul and he's made it even easier. You do not need all codes 32...127, just 32 is enough. any character that is missing form the atlas reverts to 32 (Space).

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th May 2012 16:45
That is so cool. I like the idea of specialty character set files.

Cheers,
Ancient Lady
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 24th May 2012 18:11
Thanks BatVink. Question: What did you enter for the Final Image Width and Final Image Height in the Image Joiner utility, what resolution is the final texture? I'm confused by the subimages coordinates in your example, e.g., "3.png:820:256:204:256" doesn't this indicate that the height of 3 is 0 pixels (256 to 256)? Perhaps I'm just not very familiar with the subimages mechanics.
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 24th May 2012 19:15
xCept, the params are not x1:y1:x2:y2.

They are x1:y1:h:w.

Those last two are height and width.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th May 2012 22:33
Rich is correct. The width/height I entered was 1024 x 512, to make them powers of 2.

xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 25th May 2012 08:46
Got it, thanks!

Login to post a reply

Server time is: 2024-04-28 16:43:23
Your offset time is: 2024-04-28 16:43:23