About Store Forum Documentation Contact



Post Reply 
Gui Text problem
Author Message
Kiekos Offline
Member

Post: #1
Gui Text problem
Hey there!

I've started making myself a debugger which would show current position of player, monster that I'm fighting and some other stuff.

I've prepared a function ftoa() which converts float to string so that I can draw it on the screen (I don't think there's a different way to draw it). So there's this thing:

Code:
Flt test = 12345.123;
D.text(0, 0, ftoa(test) );

And it works fine... I mean the number is drawn on the screen. But when I try to put the number into a Text in Gui object it shows "???" instead of the actual number.

Code:
Flt test = 12345.123;
debugger.getText("chr_pos_x").set( ftoa(test) );

And as I said before it results in "???" being put in the Text box...

Any help will be much appreciated,
Kiekos
(This post was last modified: 12-03-2013 12:41 PM by Kiekos.)
12-02-2013 07:29 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Gui Text problem
please use "S+1.234"
"S+test"
12-02-2013 11:18 PM
Find all posts by this user Quote this message in a reply
Rofar Offline
Member

Post: #3
RE: Gui Text problem
Also, there is an engine function for converting floats to strings...TextFlt().
12-02-2013 11:53 PM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #4
RE: Gui Text problem
Yep, that works! Thanks smile
12-03-2013 01:53 PM
Find all posts by this user Quote this message in a reply
Post Reply