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

#1

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]
0 Likes

#2

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

0 Likes

#3

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

0 Likes

#4

Thanks. It could be something in the font shader.

0 Likes

#5

Thanks.

0 Likes

#6

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

0 Likes

#7

@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.

0 Likes

#8

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

2 Likes

#9

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.

0 Likes

#10

@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