playMaker

Author Topic: How do you get a Box Collider on a GUI Texture?(Solved)  (Read 3063 times)

Saputo

  • Full Member
  • ***
  • Posts: 107
How do you get a Box Collider on a GUI Texture?(Solved)
« on: September 24, 2013, 10:38:43 AM »
How do you get a Box Collider on a GUI Texture?

I have a Menu screen, where I use another Image as a X button and if it's clicked it close's the Menu Screen BUT I had to use GUI Textures so that way they would be in the right places when the screen size was changed, and With GUI Textures you can't use Collider's on them Properly.
They only make a straight line, and not a box or anything not even an outline of a box, so doing this does not work. Does anyone know another way to go about this? Id like to be able to use Mouse Pick Event Action on this as well, this is why I require a Collider.

                                           Saputo
« Last Edit: September 25, 2013, 10:34:22 AM by Saputo »

redikann

  • Full Member
  • ***
  • Posts: 174
Re: How do you get a Box Collider on a GUI Texture?
« Reply #1 on: September 24, 2013, 04:48:56 PM »
you could overlay a quad in the portion of the screen with no mesh renderer just a collider. Depending on your setup you might need to parent it too the camera.

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: How do you get a Box Collider on a GUI Texture?
« Reply #2 on: September 24, 2013, 08:54:13 PM »
the GUI Texture position changes depending on the screens size so I can't do that sadly I was thinking about making it so you can just click any were and it will close, but IDK if that will work well b.c you have to be able to click other areas on the map and other objects in the menus.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do you get a Box Collider on a GUI Texture?
« Reply #3 on: September 25, 2013, 02:01:08 AM »
Hi,

 GUITexture reacts to input events, so simply implement the playmaker system events "MOUSE DOWN" and or "MOUSE UP"

bye,

 Jean

Saputo

  • Full Member
  • ***
  • Posts: 107
Re: How do you get a Box Collider on a GUI Texture?
« Reply #4 on: September 25, 2013, 09:43:55 AM »
OH Hell yea, thank you once again Jean Live Saver :D