x


int to string for a HUD guitext

hi there, i am trying to make the HUD show me how many points i allready got while playing... my problem: i can't get my gui text to show me the content of the var -.-

thanks for your help!

here is my script:

var asl = punkte_Sammeln.PUNKTE;

function Update () {
    var ptt = ToString(asl);

    guiText.text = ptt;
}
more ▼

asked Feb 28 '11 at 08:51 PM

allesisda gravatar image

allesisda
8 3 4 11

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Quite simple. In .Net/Mono every object have a built in function .ToString(). You can do this:

var asl = punkte_Sammeln.PUNKTE;

function Update () {
    var ptt = asl.ToString();
    // or what would work too:
    // var ptt = "" + asl;
    guiText.text = ptt;
}

Viel glueck ;)

more ▼

answered Feb 28 '11 at 09:18 PM

Bunny83 gravatar image

Bunny83
45.4k 11 49 207

(comments are locked)
10|3000 characters needed characters left

thanks a lot for the fast answer!

more ▼

answered Feb 28 '11 at 09:59 PM

allesisda gravatar image

allesisda
8 3 4 11

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x226
x114
x105
x19

asked: Feb 28 '11 at 08:51 PM

Seen: 4555 times

Last Updated: Feb 28 '11 at 09:22 PM