Jump to content
  • Advertisement
Sign in to follow this  
95CKILMA

[.net] Iregular GUI elements

This topic is 4373 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
Advertisement
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
but if ive generated a region feom distinguishing previously whats transparent and whats not surly thats the same? and it would also be quicker than checking hte pixle in real time?

Share this post


Link to post
Share on other sites
Is speed really that necessary? Unless you're talking about 100 clicks/minute or something silly. Also, if you have a lot of GUI elements do you really want to have to pre-generate all those regions?

Share this post


Link to post
Share on other sites
yer tbh u got a point their, that just me thinking well if im gona do summet i dont wanta have to redress it later, but your right the difference wouldnt be significant i guess

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!