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 2 : Text & fonts

Author
Message
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 16th Feb 2016 15:30
Hi, I use AppGameKit 1 , tier 1 a *lot*, and I mostly love it. I am curious about agk2. maybe I will upgrade, maybe not. but my question is this:

Are text and fonts any better in AGK2 ? agk1 has a single built-in font, which generally looks pretty bad.
Also, text scaling usually looks pretty bad.

So, does AppGameKit 2 do text any differently?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th Feb 2016 17:06
AGK1 and 2 can both use different fonts. The default font is just a bitmap font, you can change it with SetTextFontImage() and SetTextDefaultFontImage().
Regarding quality, it all depends on the size of the image you start with. The characters need to be the same size of the largest resolution you want to display.
I have an app with lots of small text and some large numbers. I load the large numbers from a different bitmap with just the 10 numbers in it. This allows me to use clear numbers without too much overhead.

Text aside, I would upgrade to V2 because it is so much better in many respects.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 16th Feb 2016 17:11
Also, check out this incredible TrueType to Bitmap font utility!
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 16th Feb 2016 20:53
What BatVink said. Fonts already works in v1 but v2 had a lot of sweat stuff and more is coming. There are already improvements to arrays and types that comes in handy for any game. There's a debugger now. Is the new IDE part of v2 or was that in v1 as well? Can't remember. It takes only a few seconds to compile any project and you can export as .apk. And there are more free updates coming this year!
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 18th Feb 2016 01:50 Edited at: 19th Feb 2016 14:20
The IDE alone is reason good enough to update from v1 to v2.

As for fonts, as have been mentioned, these need be imported into your project. First you need convert a font from its native vector-based format (typically TrueType or OpenType) using a tool such as the one CJB linked to or UO Bitmap Font Creator. Anyway, using such a tool you'll make a .png font-image and an accompanying text-file that you need save in your projects "../media" folder.

Next you need import that font-image into your project. Within AppGameKit (both 1 and 2) there is a host of commands available to manipulate the output of the font-formatted text. An example code importing a font-image named "arial.png" and then writing "Hello World" with changing character colours in a pulsating effect:

Login to post a reply

Server time is: 2024-09-29 11:32:11
Your offset time is: 2024-09-29 11:32:11