How to set color and tracers on spawned objects?
8 posts • Page 1 of 1
How to set color and tracers on spawned objects?
Not really much I can say that the title doesn't already tell you 

(/)(°,,,°)(/)
-

pnvv - Posts: 670
- Joined: Tue Aug 26, 2014 11:46 pm
- Location: Disunited States of America
Re: How to set color and tracers on spawned objects?
you mean on how to spawn an object with a tracer that has a color that you want,huh? 
waiting for semester break to come...
-

faytree - Posts: 947
- Joined: Mon Nov 05, 2012 1:37 pm
- Location: Selangor, Malaysia
Re: How to set color and tracers on spawned objects?
Simple! Here's the example code! :
i hope that it helps you out
- Code: Select all
scene.AddCircle({
color := [0, 0, 1, 1];
radius := 0.1;
pos := pos
});
scene.addPen({
Size := 0.1;
color = [1, 0, 0, 1];
pos := pos
})
i hope that it helps you out
- Attachments
-
Help_1.phz- Example scene (Algodoo only)
- (5.58 KiB) Downloaded 49 times
waiting for semester break to come...
-

faytree - Posts: 947
- Joined: Mon Nov 05, 2012 1:37 pm
- Location: Selangor, Malaysia
Re: How to set color and tracers on spawned objects?
Helped me very much. But I have another question: Where to access the numbers that define the color. I looked at the "appearance" option and I just got a bunch of percentages.

(/)(°,,,°)(/)
-

pnvv - Posts: 670
- Joined: Tue Aug 26, 2014 11:46 pm
- Location: Disunited States of America
Re: How to set color and tracers on spawned objects?
Well,that's very simple.But remember,Algodoo has2 color variables which is:
1.Color
2.ColorHSVA
both of those variables works differently,
for example:
While,ColorHSVA is way more different than the Color variable.
For example:
i hope that it helps
1.Color
2.ColorHSVA
both of those variables works differently,
for example:
- Code: Select all
Color = [Red,Green,Blue,Appearance]
so,if i want to make a yellow color,i'll write:
[1,1,0,1] into the Color variable
and if i want to make a purple color,i'll write:
[1,0,1,1] into the Color variable
While,ColorHSVA is way more different than the Color variable.
For example:
- Code: Select all
ColorHSVA = [Hue,Saturation,Value,Appearance]
if i want to make a bright yellow color,i'll write:
[60,1,1,1] into the ColorHSVA variable
and if i want to make a dark yellow color,i'll write:
[60,1,1,0.5,1] into the ColorHSVA variable
i hope that it helps
waiting for semester break to come...
-

faytree - Posts: 947
- Joined: Mon Nov 05, 2012 1:37 pm
- Location: Selangor, Malaysia
Re: How to set color and tracers on spawned objects?
It's worth noting that each value is linked, as in, you update one, the other will be updated. the RGBA is probably the easiest, RGB is the relevant colours, you may remember the 0-255 ranges in other applications, it's pretty much the exact same just divided into a range of 0-1. As for A, Alpha, is the transparent of the object for a more accurate term!
When asking for help, READ THE STICKIES!
- electronicboy
- Posts: 1694
- Joined: Mon Aug 31, 2009 6:18 pm
Re: How to set color and tracers on spawned objects?
Both you guys helped a lot. Thank you very much.

(/)(°,,,°)(/)
-

pnvv - Posts: 670
- Joined: Tue Aug 26, 2014 11:46 pm
- Location: Disunited States of America
8 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests



