Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
arwe2793

moise perss on gui texture doesnt work :/

Question

right now at this moment im trying to find solution. i make a gui texture the attack this script...  

Please login or register to see this code.

but it dont show debug, and dont change texture, nor clicking on it works :/ where is a problem ;/ i whach a tut in youtube, did same but it working on his pc, not mine

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

i read here : Please login or register to see this link.   that on unity 2.6 was a bug that on windows OnMouseDown didnt work while on mac it's works, and on 2.6.1 that bug was fixed... so im on unity 4.5.1f3 and win8.1, probably same glich here, so i going to update unity now and check how its will be then :)

Share this post


Link to post
Share on other sites

  • 0
Please login or register to see this quote.

lol x.x thank you, i tried to add box colider before, but didnt worked, now when i restart unity i did again as u sayd and its magicly strat working...

Share this post


Link to post
Share on other sites
  • 0

And if you ever want to click a texture in on OnGUI you can do:

var image: Texture2D;

var hoverImage : Texture2D;

function OnGUI()

{

var r : Rect = Rect(0, 0, 100, 100);

var curImage : Texture2D;

if(r.Contains(GUIUtility.ScreenToGUIPoint(Input.mousePosition))

{

curImage = hoverImage;

if(Event.current.button == 0 && Event.current.isMouse) print("clicked");

}

else

{

curImage = image;

}

GUI.Label(r, curImage);

}

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

thank you, once i search in web how tu make gui buton with texture, but didnt get in head that i could use gui texture instead :d

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...