Author Topic: Very strange behaviour when changing sprite color (I get a spidy web-like shape)  (Read 1455 times)

vexe

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 153
    • View Profile
Hello, I've just added a new feature to my inventory system, just like in RTS games, if you hold the item with the mouse (pick it up) if you try to place it in a place where it can't fit, I change the color tint of the rect/background that's drawn behind the item texture to red, where if you hover over an area that the item can fit it, I change the color to green indicating that it can fit there.
(attachment no. 1)

Again, I do that by changing the color of the rect:
  1. public void ChangeFitIndicatorColor(bool doesItemFit)
  2. {
  3.         // rectTexture is a sliced sprite / has a UISlicedSprite script attached to it
  4.         rectTexture.color = (doesItemFit) ? fitColor : doesntFitColor;
  5. }
  6.  

But sometimes, for no reason, I get some really awkward looking spdiy web-like thing, from the point I click to pick the item, to the cursor, inside that weby thing, I sometimes see some of the textures in my atlas, or the color tint (red|green), really strange. Please look at the 2nd attachment.

Any idea why this is happening and how to prevent it? - Thanks a lot!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
That looks like graphical corruption to me. If you haven't changed anything in NGUI, your videocard may be crapping out.