Go.set("#label", "color",) function may be not working in html5?

To Reproduce (REQUIRED)
Hello

I want to control alpha of label attached gameobject.
But this code

go.set("#label", "color", vmath.vector4(1, 1, 1, 0))

html5(chrome)
image3
windows 10
image4
is not working in html5 ,but working on windows.
on the other hand this code

go.animate("#label", "color", go.PLAYBACK_LOOP_PINGPONG, 
vmath.vector4(1,1,1,0), go.EASING_OUTSINE, 2)

is working html5 and windows.
But label component can’t set start alpha.
I want to tween alpha of label from 0 to 1 on html5.
This is bug?
or
my usage is something wrong?
Expected behaviour (REQUIRED)
Control alpha of label on html5.

Defold version (REQUIRED):

  • Version [1.2.177]

Platforms (REQUIRED):

  • Platforms: [Windows, HTML5]
  • OS: [Windows 10,]
  • Device: [desktop]
1 Like

Are you sure? There shouldn’t be a difference between the two platforms. Does nothing happen in html5?

Yes.
I try again this code

go.set("#label", "color", vmath.vector4(0, 1, 1, 0.5))

html5(chrome)
image1
windows 10
image2
RGB is working,but only alpha of label may be not working on html5

Thanks. It could be something in the font shader.

Thanks.

Created issue on GH: https://github.com/defold/defold/issues/5428

@tiki thanks for the report!
If you wouldn’t mind, please attach a small repro case to the issue. It’ll make it easier/faster for the developer that takes a look at the issue.

Attached repro case to the issue on GH : https://github.com/defold/defold/issues/5428

2 Likes

HTML5 target is more picky about ints vs floats in its shaders, generally best to stick with floats. Even when you want to zero something out so 0. or 0.0 for clarity. That would mean floats for all values too. Check the console to see if there is any warning about that.

1 Like

@Pkeod
Thank you for your help.
I confirmed chrome console


I didn’t have discover warning about float values.
But because of using gui attached label can control alpha of label on the editor,
so my problem may be solved.
I will return my game development.
Actually,this is my first time experience to question in English.

2 Likes

Got same problem on Defold 1.2.185, Windows 10, Chrome 92, Firefox 88
problemo

2 Likes