Sign in to follow this  

[.net] Iregular GUI elements

This topic is 4092 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok I've figured how to do this (i belive) however i don think its the best way so im looking for more experience insite. what im looking at is making gui elements (buttons being the best example) that are iregular shapes, such as circles or arrows. Now drawing and rendering isnt a prob however clicking them... normaly id do a rectangle and a x y contain check but well they aint square are they. My solution is to do a IsVisible check on a region that is the shape of the element, the region being generated by a graphicpath which would have to be either made at the load or made though another app and then loaded. this is do able but i dont think the best way so any input would be good btw im using MDX (looking to move to XNA eventualy, either solution will do) thx Ant p.s anyone know why i can post at home but not at work?

Share this post


Link to post
Share on other sites
thx 4 the reply that seams to back up my idea then of usng graphics paths to regions although he dosnt actually check the region when trying to click.

the one thing id know now is the quickst way to get a graphics path out of an image. the only way i know is checkign each pixle.

Share this post


Link to post
Share on other sites
Ideally, you check the pixel in the texture that's clicked to see if it's transparent or not. Here's an article on pixel collision detection in XNA that can be modified to do the job. Instead of checking the pixels in a bounding box of the intersection of the two sprites you just check the one pixel.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Machaira
Is speed really that necessary? Unless you're talking about 100 clicks/minute or something silly.


Ya, but you know some dumbassed end user will try it at some point. :-)



P.S. I'm just joking, but it is kinda true...

Share this post


Link to post
Share on other sites

This topic is 4092 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this