Tracer script

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

Tracer script

Postby mattyboy » Fri Nov 06, 2009 4:12 am

i was just wondering if it would be possible to, using script, press a button and make a pen's diameter bigger? if you know how to do this, plz post the code
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Tracer script

Postby standardtoaster » Fri Nov 06, 2009 5:07 am

Make a variable:
Code: Select all
scene.my.size = 1

Code: Select all
scene.my.size = scene.my.size + 0.1

In the size part of the pen put:
Code: Select all
{scene.my.size}

Use the same 'toggle' method as you used before to make the button do what you want.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Tracer script

Postby mattyboy » Fri Nov 06, 2009 5:22 am

thnx i just couldnt find the variable name... i tried like 20 diffrent things and never thought of the word size :problem:
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Tracer script

Postby niffirg1 » Fri Nov 06, 2009 5:32 am

What do you mean could not find variable name?
User avatar
niffirg1
 
Posts: 376
Joined: Mon Aug 31, 2009 10:31 pm
Location: The Great American South!

Re: Tracer script

Postby KarateBrot » Fri Nov 06, 2009 7:38 am

You can use any variable name you want. you could also name it "scene.my.idontcarewhatthisvariableiscalled" instead of "scene.my.size". he just named it "size" because if you have multiple variables you know what is what.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Tracer script

Postby mattyboy » Sat Nov 07, 2009 3:07 am

:lol: i just found that out
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 15 guests