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 / How do I position an integer?

Author
Message
Kobaltic
13
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 24th Nov 2013 02:43
I want to display an integer. If I use a print I can't seem to position it where I want it on the screen. If i convert it to text then it doesn't update the text on the screen. Any thoughts? Thanks in advance.
xCept
22
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 24th Nov 2013 03:09
You should create a text object, then pass the integer to it as a string using Str(). See below:



This will position an integer value at (50, 50) and will update the integer when you click the mouse or tap your finger on the screen. There are also text alignment options that can be used as needed.
Zwarteziel
14
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 24th Nov 2013 03:13 Edited at: 24th Nov 2013 03:16
Are you using the CreateText command with an integer converted to a string? i.e.:



If so, you'll need to either update the string or delete it and re-create it when your integer updates. You can use the SetTextString and DeleteText-commands to do this.

edit: realized you should be able to update a string as well.
Kobaltic
13
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 24th Nov 2013 03:42
Thanks I just had to add the setTextString to the update and now it is working good. Thanks again.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Nov 2013 23:14
When debugging, I often like to print a lot of stuff to the screen here and there. It's very annoying to have to create new text objects and manually update their string values every time I want to output a variable. So I wrote this:

http://forum.thegamecreators.com/?m=forum_view&t=205111&b=6

Kobaltic
13
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 1st Dec 2013 03:46
Thanks for that function. I will look into using it.

Login to post a reply

Server time is: 2025-05-23 17:06:17
Your offset time is: 2025-05-23 17:06:17