Le Twitch Posted September 20, 2014 Share Posted September 20, 2014 I'm trying to tint a bitmap text and no matter what colour I choose, it always comes out black. the text is completely white. Tilde 1 Link to comment Share on other sites More sharing options...
Sebi Posted September 20, 2014 Share Posted September 20, 2014 You need to show some code. Link to comment Share on other sites More sharing options...
alex_h Posted September 20, 2014 Share Posted September 20, 2014 Most likely you are using the wrong format for the colour value. It needs to be a number like 0xff0000, not a string like "#ff0000" or "red"myField.tint = 0xffcc00;the above works for me. Tilde 1 Link to comment Share on other sites More sharing options...
Robske Posted September 20, 2014 Share Posted September 20, 2014 in addition to alex_h: make absolutely sure the value is 0x and the 6 digits. We had issues with shorthand notation for colors that was driving me nuts. we used: 0xfff for white, which, of course is false. Link to comment Share on other sites More sharing options...
lewster32 Posted September 20, 2014 Share Posted September 20, 2014 Yeah you cannot use shorthand with JavaScript numbers, as they're interpreted literally; 0xfff === 4095 and 0xffffff === 16777215. Three digit hex codes are a shorthand added to the CSS specification but only make sense if the interpreter is expecting either a 3 or a 6 digit hex code. The 0x notation used by JavaScript always direcly represents actual numbers and can be any length. Link to comment Share on other sites More sharing options...
Le Twitch Posted September 21, 2014 Author Share Posted September 21, 2014 Most likely you are using the wrong format for the colour value. It needs to be a number like 0xff0000, not a string like "#ff0000" or "red"myField.tint = 0xffcc00;the above works for me. Thanks for the help, it works now. Now I have another problem :S 0x000000 which is black, doesn't work Tilde 1 Link to comment Share on other sites More sharing options...
lewster32 Posted September 21, 2014 Share Posted September 21, 2014 Yes, this is a bug in pixi I believe - you can get away with setting it to 'near black' for now: 0x010101 Tilde 1 Link to comment Share on other sites More sharing options...
Le Twitch Posted September 21, 2014 Author Share Posted September 21, 2014 Yes, this is a bug in pixi I believe - you can get away with setting it to 'near black' for now: 0x010101 Ahh okay. Thanks for the info Link to comment Share on other sites More sharing options...
MichaelD Posted January 23, 2015 Share Posted January 23, 2015 I have a sprite and using the above solution but it doesn't work. The sprite remains as is and doesn't change at all. I use :item.tint = 0xff0000;Any ideas? Is the tint only available for WebGL or also Canvas? Link to comment Share on other sites More sharing options...
Recommended Posts