|
| 20 Jun 2017 04:22 PM |
Basically:
I have an ImageButton with a quite irregularly shaped image and need to detect when the mouse is hovering over it. However ROBLOX's crap detection system only detects if the mouse is within the bounding box of the image. I need a better way to detect if the mouse is inside the image (i.e. over a spot that a pixel of the image is occupying).
Any suggestions?
choo choo |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2017 04:55 PM |
you can't
don't blame roblox, that's how technology works |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2017 05:11 PM |
Bud, even Game Maker has the kind of mouse detection I'm describing, and you're telling me that the technology just isn't there yet. LOL. Either you're dumb or you don't understand what I'm asking for. Either way, you shouldn't have replied.
choo choo |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 20 Jun 2017 05:17 PM |
You'll have to define vertices around your image and create a mesh overlay, then it's just checking if the mouse is within any given triangle//polygon of the mesh.
|
|
|
| Report Abuse |
|
|
|
| 20 Jun 2017 05:18 PM |
Thank you, I'll look into that.
choo choo |
|
|
| Report Abuse |
|
|
reeserly
|
  |
| Joined: 27 Jan 2017 |
| Total Posts: 2 |
|
|
| 20 Jun 2017 05:19 PM |
| ßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßichßich ßichßichßichßichßich ßich ßich ßich |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2017 08:15 PM |
I haven't been able to find anything online on how to "draw" a shape based on given vertices. Any help?
choo choo |
|
|
| Report Abuse |
|
|
Tunicus
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 3165 |
|
|
| 20 Jun 2017 08:24 PM |
| try a convex #### algorithm? |
|
|
| Report Abuse |
|
|
Tunicus
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 3165 |
|
| |
|
|
| 20 Jun 2017 09:25 PM |
| OK so it seems like what I'm really looking for is how many times a given point will intersect the convex #### of an array of points when a ray is shot to the right. Now how do I do that? choo choo |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2017 09:31 PM |
Math, google, and patience.
It's delightful! It's delicious! It's delovely! |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2017 09:34 PM |
Been Googling for the past hour or so, so far no results. I'm still looking though, trying not to give up!
choo choo |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2017 11:14 PM |
Did it. I might be the first person on ROBLOX to use a complex bounds algorithm with an ImageGui for figuring out if the mouse is inside it.
choo choo |
|
|
| Report Abuse |
|
|
Tunicus
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 3165 |
|
|
| 20 Jun 2017 11:30 PM |
| i think i found the algorithm you used and it's much simpler than i expected. bookmarking this for later +1 |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2017 11:35 PM |
I used some Lua code I found on StackOverflow. I literally just Googled "check if point lies in polygon lua".
This is definitely something that will be useful if you use ImageGuis a lot.
choo choo |
|
|
| Report Abuse |
|
|