playMaker

Author Topic: Can't change Image Color via Set Float Value or Set Color RGBA/Value[SOLVED]  (Read 1042 times)

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 968
    • View Profile
    • Fat Pug Studio
Hi,

i need to change the alpha of an image that's on the object childed under canvas. It contains rect transform, canvas renderer and Image (UnityEngine.UI.Image) itself.

I tried the following:

Getting the color and storing it under global color variable and changing it on runtime - it doesn't work.
Getting the color and storing it under global float variable and changing it - it doesn't work.



Source image is populated on runtime, of course.

It just doesn't get affected, any ideas?
« Last Edit: February 28, 2017, 06:49:55 AM by jeanfabre »

terri

  • Sr. Member
  • ****
  • Posts: 373
    • View Profile
    • terrivellmann.tumblr.com
Re: Can't change Image Color via Set Float Value or Set Color RGBA/Value
« Reply #1 on: February 27, 2017, 05:13:19 PM »
I just tried it and it works fine? Are you using the U Gui Graphic Get Color action?

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 968
    • View Profile
    • Fat Pug Studio
Re: Can't change Image Color via Set Float Value or Set Color RGBA/Value
« Reply #2 on: February 28, 2017, 12:32:43 AM »
No, just plain old get property/set float value




and getting color and setting color rgba.

It works with U Gui graphic set color, thanks for that terri, but it puzzles me why simple property manipulation does not work. Goddamn UI.

« Last Edit: February 28, 2017, 01:14:24 AM by krmko »

terri

  • Sr. Member
  • ****
  • Posts: 373
    • View Profile
    • terrivellmann.tumblr.com
Re: Can't change Image Color via Set Float Value or Set Color RGBA/Value
« Reply #3 on: February 28, 2017, 02:57:00 AM »
Hm, and I tried it and get/set property works for me.
I mean, in your shot it seems to return 1, which is the full value? (its on a 0-1 scale)

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 968
    • View Profile
    • Fat Pug Studio
Oh don't mind the values, they're not on runtime. It gets 1, but it sets 0, unfortunately, though it says 0 in the field, nothing happens on the color picker itself. Funny, ain't it ???

Or maybe it's just one of my 1AM bollocks where i unknowingly messed up something.

Thanks once again terri, marked as solved!