Browse Search Popular Register Upload Rules User list Login:
Search:
Mouseover Code Injector

Image:
screenshot of the scene

Author: s_noonan

Group: Technical

Filesize: 217.16 kB

Date added: 2019-07-16

Rating: 5.6

Downloads: 470

Views: 253

Comments: 6

Ratings: 2

Times favored: 0

Made with: Algodoo v2.1.0

Tags:
tool

Scene tag

Mouse-over Code Injector

Rev A: Now works on rotated star.
Rev B: Added _onMouseUp, _onMouseDown, _onMouseOver, _onMouseNotOver, and _onClick events.
Rev C: Coded for better efficiency. When testing with (8) stars 40 FPS was 2.5 FPS and 92% sim speed was 4.2%.
Rev D: Fixed memory leak.
Last edited at 2019/09/15 13:55:51 by s_noonan
Please log in to rate this scene
edit
Similar scenes
Title: Mouseover Light
Rating: 5
Filesize: 222.64 kB
Downloads: 243
Comments: 2
Ratings: 1
Date added: 2019/07/20 10:59:49
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Shade's Toolbox
Rating: 5
Filesize: 28.96 kB
Downloads: 283
Comments: 1
Ratings: 1
Date added: 2018/09/21 22:49:07
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Mouse Scrolling
Rating: 6.5
Filesize: 96.39 kB
Downloads: 633
Comments: 7
Ratings: 4
Date added: 2023/07/09 10:23:43
Made with: Algodoo v2.1.0
Rating: rated 6.5
download
Title: Code Reference V1.1
Rating: 5
Filesize: 50.55 kB
Downloads: 356
Comments: 3
Ratings: 1
Date added: 2022/10/07 21:03:03
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: [LAG?] Bounding Box Creator for Polygons
Rating: 5.375
Filesize: 11.16 kB
Downloads: 534
Comments: 5
Ratings: 2
Date added: 2024/06/17 11:19:05
Made with: Algodoo v2.1.0
Rating: rated 5.4
download
Title: Turbojet
Rating: 5
Filesize: 42.48 kB
Downloads: 1428
Comments: 1
Ratings: 1
Date added: 2012/11/19 13:46:07
Made with: Algodoo v2.0.2 Edu
Rating: rated 5
download
Where's Homer? :o



Well, even without Homer, this scene is really cool. How do you come up with these ideas? I mean, you're just an ME, and this scene doesn't have any gears in it. :lol:
Last edited at 2019/07/16 18:09:18 by Xray
Thanks. I was thinking of making a _onDesignClick function that is an onClick function that works when the simulation is not running. This is just one step along the way.
Last edited at 2019/07/16 23:38:35 by s_noonan
I played around with your scene a bit and came up with a couple of ideas that you might consider adding to it as follows:

1. Provide a selection of "trigger" entities such as, 1. The mouse cursor (default), 2. One or more "scene.my.whatever_pos". With more triggers, a user has options to use either the mouse cursor, or to use some geometry pos. One caveat, and that is when there are more than a few items in the scene with your added code in them, the computer (mine) starts to lag very quickly with increased numbers.

2. Provide a choice of colors for the "hover" and the "non-hover" pos trigger.

3. Maybe provide a place to add personal code for the person who would rather have something else happen when triggered rather than a simple color change.

I'm sure I could think up more things for you to do, but that's enough for now! LOL
The new code addresses #3. So 1 out of 3 isn't so bad.
Nope, not bad at all!

I discovered an interesting effect after injecting the color changing code into the star. Using the knife tool, I cut the star into 7 or 8 ribbons, and then I ran my cursor over the ribbons. Cool effect, but you can't cut a polygon into too many pieces because of the lag issue which increases with the number of geoms that contain your code.

Nice job. :tup:
Last edited at 2019/07/18 04:26:39 by Xray
I tried the effect. It doesn't take many pieces to slow things down. If I convert the pieces to circles or squares then the response is much faster. I might be able to improve the efficiency of the pointInPoly function. I could consider the point is in a polygon if it's within the average distance between the polygon center and the surface points.