Announcement

Collapse
No announcement yet.

Changing Color of Border in Widget on Mouse Press

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Changing Color of Border in Widget on Mouse Press

    Hi Guys

    I have an inventory system which has a grid which contains a number of Inventory Slots (slot widget). What I'm looking to do is when I click on one of the Slots, I want to change it's border color and if I then click on a different Slot, it reverts the previous one back to the original color, and then changes the color of the new slot.

    I am able to change the color on mouse press no problem, however not sure how to change it back when I click on another slot. At the moment, every slot I click on changes color to the new color without the previous one reverting back.

    Any Ideas?

    Thanks.

    #2
    Depending on your setup you maybe able to use a simple int array to save costs, and depending on your slot style this may or may not be a solution, but you get the basic idea, for all occupied slots set colour based on a simple branch/if statement, when you click on a slot set it to the active int,

    Click image for larger version

Name:	setcolours.JPG
Views:	1
Size:	121.5 KB
ID:	1589771

    Click image for larger version

Name:	demo.JPG
Views:	1
Size:	21.8 KB
ID:	1589772

    Comment


      #3
      Thanks for the tip. I will give this a go and see how it works out.

      Comment

      Working...
      X