Jump to content

Difference in tint text/graphic


divers
 Share

Recommended Posts

Hello I have a little problem :)

I am tinting graphics and its work well, then I want to tint the bitmap text the same way so the graphics and text have the same color.

And there is a problem, because it gives various results.

bg1 = game.add.graphics(0,0);
bg1.beginFill(0xffffff,1);
bg1.drawRect(15, 15, 330, 550);
bg1.tint = 0xEBEBEB;


Score = game.add.bitmapText(0,0,'score','0', 120);
Score.tint = 0xEBEBEB;

// to this point, everything is correct, graphic and text have the same color

// now in function i am changing tint in bg1 and it works
bg1.tint =  Phaser.Color.interpolateColor(colorData1[index-1],colorData1[index],duration,currentStep);
// then I want the same for the text, but it gives different result
Score.tint = bg1.tint;

The font is white so as the graphics.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...