Change color!

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

Change color!

Postby jake2247 » Sat Mar 06, 2010 1:39 pm

i didnt see any topic where i can change color if laser is hitting.... i want it to change to gold color so any?
one topci was like that but i want it to be black im not so advanced but still :D so... i want it to change color to gold/yellow. thanks!
jake2247
 
Posts: 7
Joined: Sat Mar 06, 2010 1:34 pm

Re: Change color!

Postby Mr_Stabby » Sat Mar 06, 2010 4:36 pm

e.laser.color=[0.8, 0.6, 0, 1]

put that in either laser or target script box
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: Change color!

Postby jake2247 » Sat Mar 06, 2010 6:47 pm

can you say it all like that (e)=> and all those? :crazy:
jake2247
 
Posts: 7
Joined: Sat Mar 06, 2010 1:34 pm

Re: Change color!

Postby KarateBrot » Sat Mar 06, 2010 7:00 pm

Code: Select all
(e)=>{ e.laser.color=[0.8, 0.6, 0, 1] }
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Change color!

Postby jake2247 » Sat Mar 06, 2010 8:09 pm

OWw... :oops: i mistake i want so if laser hits some box or that so it will change its color to yellow/gold permanently :problem: sorry...
jake2247
 
Posts: 7
Joined: Sat Mar 06, 2010 1:34 pm

Re: Change color!

Postby KarateBrot » Sat Mar 06, 2010 8:26 pm

Code: Select all
(e)=>{ e.geom.color=[0.8, 0.6, 0, 1] }
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Change color!

Postby jake2247 » Sat Mar 06, 2010 8:45 pm

Can i get it yellower? :D

*Light yellow*
jake2247
 
Posts: 7
Joined: Sat Mar 06, 2010 1:34 pm

Re: Change color!

Postby KarateBrot » Sat Mar 06, 2010 8:50 pm

Code: Select all
(e)=>{ e.geom.color=[0.8, 0.7, 0.2, 1.0] }

Well, experiment yourself. You know how to mix colors? If so, do it. The first value is for red, the second for green and the third for blue. (The fourth is just transparency)
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Change color!

Postby jake2247 » Sat Mar 06, 2010 8:53 pm

Ohh thanks for lesson ;D

And this is last one ;O how i can make so when it hit laser so it will draw it in this color : 0.954, 1.0, 0.0, 1.0 and it uncheck the "Draw circle cake" thing? and =I how i can make so when i have been created a box what will spawn circles how i can make so these will be "move selected to back"? begause i make golden machine and i want to make a Big box to hide it [i know someone can delete it and search it :D] but it for realistic. thanks :D

[sorry when i´m so annoying ;I]
Last edited by jake2247 on Sun Mar 07, 2010 1:38 pm, edited 1 time in total.
jake2247
 
Posts: 7
Joined: Sat Mar 06, 2010 1:34 pm

Re: Change color!

Postby RicH » Sun Mar 07, 2010 5:26 am

Millions of voices suddenly cried out in terror, and were suddenly silenced. Something terrible has happened.
User avatar
RicH
[Funniest Person 2010]
 
Posts: 2043
Joined: Tue Sep 01, 2009 9:01 am

Re: Change color!

Postby jake2247 » Fri Mar 26, 2010 12:22 pm

And this is last one how i can make so when it hit laser so it will draw it in this color : 0.954, 1.0, 0.0, 1.0 and it uncheck the "Draw circle cake" thing? and =I how i can make so when i have been created a box what will spawn circles how i can make so these will be "move selected to back"? begause i make golden machine and i want to make a Big box to hide it [i know someone can delete it and search it :D] but it for realistic. thanks :D
jake2247
 
Posts: 7
Joined: Sat Mar 06, 2010 1:34 pm

Re: Change color!

Postby Mystery » Fri Mar 26, 2010 12:40 pm

Code: Select all
(e)=>{e.geom.drawcake = false; e.geom.color = [ 0.954, 1.0, 0.0, 1.0]}


For your second question you want to use Zdepth

Add
Code: Select all
zdepth := -inf
to you spawn code

Code: Select all
Scene.addbox({size := [1,1]; pos := e.pos; zdepth := -inf; color := [0,0,0,1]})
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: Change color!

Postby jake2247 » Mon Mar 29, 2010 3:46 pm

Thanks :D
jake2247
 
Posts: 7
Joined: Sat Mar 06, 2010 1:34 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests

cron