Two variables in text box

About advanced scenes, and the Thyme scripting language used in Algodoo.

Two variables in text box

Postby Ivanlul » Sun Nov 01, 2009 7:31 am

I want to have two variables in a text box but it doesn't seem to be working, something like this:

A: {variable1}
B: {variable2}
Registered: 2008-10-16
Image
User avatar
Ivanlul
 
Posts: 763
Joined: Mon Aug 31, 2009 11:19 pm
Location: US

Re: Two variables in text box

Postby standardtoaster » Sun Nov 01, 2009 8:05 am

{"" + scene.my.varA + "\n" scene.my.varB}
that will give you varA with varB on a seperate line
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Two variables in text box

Postby RA2lover » Tue Nov 03, 2009 9:27 pm

also, remember that algodoo has the Math.ToString command, able to convert your general value into strings.
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Two variables in text box

Postby standardtoaster » Tue Nov 03, 2009 9:45 pm

You can also use that same funtion in phun!
Code: Select all
scene.my.toString=(N)=>{"" + N}

{"Test: " + scene.my.toString(2 + math.pi)}
{"Test: " + math.toString(2 + math.pi)}
Both of those will give you the same result.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Two variables in text box

Postby Ivanlul » Sun Nov 08, 2009 7:10 am

How can I show two variables in a single text box?
Registered: 2008-10-16
Image
User avatar
Ivanlul
 
Posts: 763
Joined: Mon Aug 31, 2009 11:19 pm
Location: US

Re: Two variables in text box

Postby standardtoaster » Sun Nov 08, 2009 7:41 am

Did you use what I posted originally?
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Two variables in text box

Postby Ivanlul » Mon Nov 09, 2009 2:24 am

It doesn't compile.
Registered: 2008-10-16
Image
User avatar
Ivanlul
 
Posts: 763
Joined: Mon Aug 31, 2009 11:19 pm
Location: US

Re: Two variables in text box

Postby standardtoaster » Mon Nov 09, 2009 2:29 am

Sorry about that. I typed it on my iPod and forgot the last plus.
Code: Select all
{"" + scene.my.varA + "\n" + scene.my.varB}

That should work now. ;D
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 9 guests