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.

Newcomers AppGameKit Corner / Scale TTF Text? Need For Our Custom GUI System...

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 1st May 2017 22:21
Hi,

Working hard now porting our GameMaker:Studio version 1 2-D game engine to AppGameKit.
We will be working soon on porting our custom GUI system with user selectable buttons and option changing arrows.
For the buttons we display a button image with TTF text on top:
[ START! ]
[Options]
[How To Play]
[High Scores]
[About]
[Exit]

We need to scale down both the button image and button TTF text when the button is selected by the user.
We see in the documentation how to scale down an image, no problem.
However we do not see in the documentation how to scale down a TTF text?

Any help with scaling a TTF text would be appreciated!
Super awesome video game engine, it was worth the $80 you charged us on Linux Steam game client...

Jesse
JeZxLee
16BitSoft Inc.
Video Game Design Studio
http://www.16BitSoft.com
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 2nd May 2017 10:22
Unfortunately, it's not possible to scale a text.
If you use SetSpriteScaleByOffset() (with centred offset), you can tried SetTextSize() when you clic on the button.

but perhap's you will find another way to do that .


It could be great to have a SetTextScaleByOffset() and SetTextOffset()
AGK2 tier1 - http://www.dracaena-studio.com
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd May 2017 11:10
I create my buttons as one image - button and text.
I do this in the game initialisation by overlaying all of the components, (button background, text) then using GetImage() to create the fully composited button.

it is a little more complex to set up, but during gameplay you are only dealing with one entity.

Using this method you can also create better, scalable buttons using methods like Scraggles 9-slice button function.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-11-22 02:21:23
Your offset time is: 2024-11-22 02:21:23