Mouse over effects
14 posts • Page 1 of 1
Mouse over effects
It can be used for various visual effects or more complex interface/scripts.
Just select code and paste it into geom's script window. You can do it for few selected geoms too.
Script for cirlces:
Script for boxes:
Demo scene:
Just select code and paste it into geom's script window. You can do it for few selected geoms too.
Script for cirlces:
- Code: Select all
_color = color;
_mouseOverCircle = {
circle := readable(owner);
r := circle.radius;
d := circle.pos - app.mousepos;
r * r > d(0) * d(0) + d(1) * d(1)
};
color = {_mouseOverCircle ? (owner._color * [2, 2, 2, 1]) : owner._color}
Script for boxes:
- Code: Select all
_color = color;
_mouseOverBox = {
box := readable(owner);
a := box.angle;
m := box.pos - app.mousepos;
mx := (math.cos(a) * m(0) + math.sin(a) * m(1));
my := ( - math.sin(a) * m(0) + math.cos(a) * m(1));
dx := box.size(0) / 2;
dy := box.size(1) / 2;
mx * mx < dx * dx && my * my < dy * dy
};
color = {_mouseOverBox ? (owner._color * [2, 2, 2, 1]) : owner._color}
Demo scene:
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Mouse over effects
Nicely done. In your style of high-level programming. Optimization and so on...
And i suppose no one to use this ever. As well as your other great achievement in scripting.
And i suppose no one to use this ever. As well as your other great achievement in scripting.
-

Nait - Posts: 224
- Joined: Fri Oct 30, 2009 1:56 am
- Location: Eastern Russia, Vladivostok
Re: Mouse over effects
Nait wrote:And i suppose no one to use this ever. As well as your other great achievement in scripting.
It's ok, I get used to this
I've post it here for myself - it's easier to find scripts here than on my pc inside some scenes.
Last edited by Kilinich on Fri Jan 06, 2012 8:34 pm, edited 1 time in total.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Mouse over effects
Kilinich wrote:It's ok, I get used to thisno players left, forum dead, algobox full of crap, and half scenes lost
![]()
I've post it here for myself - it's easier to find scripts here then on my pc inside some scenes.
It may be weird chance, but our scenes and mine of one period are recovered differently. Meaning - most of yours are and mine are not at all.
lol
Ps, hard case of necroposting...
-

Nait - Posts: 224
- Joined: Fri Oct 30, 2009 1:56 am
- Location: Eastern Russia, Vladivostok
Re: Mouse over effects
It's not recovered, I've re-post all of them. Just like wildbill did.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Mouse over effects
Keep posting scenes and showing code in the forum. They are very helpful to us who are still learning. Even if we don't use the exact code, they help us understand coding and may help spawn new ideas.
- s_noonan
- Posts: 61
- Joined: Tue Mar 30, 2010 2:25 am
Re: Mouse over effects
I agree with s_noonan. Most of Kilinich's code is over most of our heads (and I think I speak for most everyone in this forum) but it shows us what CAN be done if one wants to put forward the effort and dedication to learn more advanced techniques. I'm just mystified by some of these scripts that Kilinich comes up with, and I wish I knew where he gets this stuff from. You cannot learn those complex scripts and new techniques that no one else knows anything about by reverse-engineering other people's code! So, he must be getting this stuff from a "secret source" that he won't admit to. Maybe he has a direct comm line to Emil (?), I don't know. Whereever he gets it from remains a secret that he apparently will not compromize.
-

Xray - Posts: 501
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Mouse over effects
Actually, Emil saw my jackhammer scene and said something like that:
So.. no magic no secret sources. I'm just older than you and algodoo is my hobby.
...vertex collisions and the such in Thyme.... you are a masochist =)
omg, qSortTable you are crazy".
So.. no magic no secret sources. I'm just older than you and algodoo is my hobby.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Mouse over effects
Kilinich wrote:Actually, Emil saw my jackhammer scene and said something like that:...vertex collisions and the such in Thyme.... you are a masochist =)
omg, qSortTable you are crazy".
So.. no magic no secret sources. I'm just older than you and algodoo is my hobby.
Kilinich - Please rest assured that what I said, I said out of respect and envy. You are obviously an expert software engineer, and those of us who enjoy programming but who do not have your level of exertise can only marvel at the things you come up with! My hat goes off to you, sir!
BTW - Are you so sure that you are older than I am???
-

Xray - Posts: 501
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Mouse over effects
Xray wrote:BTW - Are you so sure that you are older than I am???
Yes, only Wild bill can compite me in that
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Mouse over effects
Kilinich wrote:Xray wrote:BTW - Are you so sure that you are older than I am???
Yes, only Wild bill can compite me in that
Are you older than 65?
-

Xray - Posts: 501
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Mouse over effects
Hmmmm.... still no answer to my last question!
Hey, Kilinich.... Is there a way you could make the mouseover effect work with polygons?
Hey, Kilinich.... Is there a way you could make the mouseover effect work with polygons?
-

Xray - Posts: 501
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Mouse over effects
Xray wrote:Hmmmm.... still no answer to my last question!![]()
Hey, Kilinich.... Is there a way you could make the mouseover effect work with polygons?
Huh? Done already. I saw your even comment that scene
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Mouse over effects
Yes, I remember that scene. Your script is vastly different between the polygon version and the box and circles versions, and so I did not mentally tie the two (poly and non-poly) versions together. Of course they have to be very different because polygons are very different from simple circles and boxes. You did a great job (as usual) on both versions. I've learned more from your scenes than from any other source in the forums or in Algobox. Thank you for your informative contributions to the Algodoo community. 
BTW - The "question" that I was referring to was the one about age. I asked you if you are older than 65 and you did not answer me. So, I assumed that for whatever reason, you did not want to answer that question.
BTW - The "question" that I was referring to was the one about age. I asked you if you are older than 65 and you did not answer me. So, I assumed that for whatever reason, you did not want to answer that question.
-

Xray - Posts: 501
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
14 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests




