1. #1

    texture highlight on mouse over


    Recently made some changes to the setup portion of my UI by creating some buttons and such. however I cant get the buttons to change texture (to give that highlighted effect) when i'm mousing over them.

    I've tried using (for example) Button:SetHighlightTexture("filepathtoadifferenttexture") but I cant get it working. I have go through other peoples code and they seem to be using this, am i missing some obvious here?



  2. #2
    Define "can't get it working", does the texture display or not? Can you give an example of what you're doing? Are you properly escaping the path (if you're using double quotes, it should be like "Interface\\Buttons\\WHITE8X8", whereas for others it's [[Interface\Buttons\WHITE8X8]]).

    Incidentally, the texture example I just used is a good one for debugging these things as it's just a giant white square.

  3. #3
    works fine, maybe it did work fine but the texture i used wasnt obvious enough

    any way i can just change the colour of the texture on highlight?

  4. #4
    If by change the colour you mean change the colour of the normal texture, then you'd probably want to put in OnEnter/OnLeave scripts and do:

    button3:GetNormalTexture():SetVertexColor(r, g, b);
    Where r, g, b are the colour components, varying based on the script (OnLeave should reset them to what they were before).

  5. #5
    as in change the colour of the texture when its highlighted instead of using a separate texture altogether. or will i need a separate texture that has been coloured differently and just point the SetHighlightTexture to the coloured version of a texture

  6. #6
    Couldn't you just SetVertexColor the highlight texture object which is returned by GetHighlightTexture?

  7. #7
    had a little play, but i guess im just not using GetHighlightTexture correctly and not getting any progress =/

    EDIT: nvm i got it, thanks guys!
    Last edited by SpaceDuck; 2012-07-09 at 08:49 PM.

  8. #8
    Oh you got it, ignore me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts