playMaker

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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • 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, 08:49:55 AM by jeanfabre »
Available for Playmaker work

terri

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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Can't change Image Color via Set Float Value or Set Color RGBA/Value
« Reply #2 on: February 28, 2017, 02: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, 03:14:24 AM by krmko »
Available for Playmaker work

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Can't change Image Color via Set Float Value or Set Color RGBA/Value
« Reply #3 on: February 28, 2017, 04: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)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • 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!
Available for Playmaker work