l8figure Posted May 25, 2020 Share Posted May 25, 2020 Title says it all. When setTint(0x0000ff), it becomes red. And when setTint(0xff0000), it becomes blue. however, when i do setTint(0xff) it becomes red? Link to comment Share on other sites More sharing options...
Milton Posted May 25, 2020 Share Posted May 25, 2020 0xff is the same as 0x0000ff. It's both 255. And both should be blue... Link to comment Share on other sites More sharing options...
l8figure Posted May 25, 2020 Author Share Posted May 25, 2020 (edited) 2 minutes ago, Milton said: 0xff is the same as 0x0000ff. It's both 255. And both should be blue... It becomes red.. Also i discovered that most colors are wrong as well, not just red and blue. The only correct colors i can get is magenta and green. Edited May 25, 2020 by l8figure Link to comment Share on other sites More sharing options...
Milton Posted May 25, 2020 Share Posted May 25, 2020 Strange. Try https://phaser.io/examples/v3/view/display/tint/single-color-tint# Works for me. Link to comment Share on other sites More sharing options...
l8figure Posted May 25, 2020 Author Share Posted May 25, 2020 1 minute ago, Milton said: Strange. Try https://phaser.io/examples/v3/view/display/tint/single-color-tint# Works for me. Yes this is a normal image, i am using bobs from blitter. Normal images are fine. Link to comment Share on other sites More sharing options...
l8figure Posted May 25, 2020 Author Share Posted May 25, 2020 (edited) Okay, this is hilarious. I tried this out of desperation: actColor=`0x${color.hex[6]}${color.hex[7]}${color.hex[4]}${color.hex[5]}${color.hex[2]}${color.hex[3]}` pixel.setTint(actColor) it worked in every color! Edited May 25, 2020 by l8figure Link to comment Share on other sites More sharing options...
Milton Posted May 25, 2020 Share Posted May 25, 2020 You're saying bobs are liitle-endian? That would be weird... Link to comment Share on other sites More sharing options...
l8figure Posted May 25, 2020 Author Share Posted May 25, 2020 4 minutes ago, Milton said: You're saying bobs are liitle-endian? That would be weird... I think they are just configured wrongly, since normal images work fine. Link to comment Share on other sites More sharing options...
Milton Posted May 25, 2020 Share Posted May 25, 2020 https://phaser.io/examples/v3/view/game-objects/blitter/bob-frame-object# Works fine for me when tinting. Are you on an oldschool system? Like a VAX or some sort of mainframe Link to comment Share on other sites More sharing options...
l8figure Posted May 25, 2020 Author Share Posted May 25, 2020 9 minutes ago, Milton said: https://phaser.io/examples/v3/view/game-objects/blitter/bob-frame-object# Works fine for me when tinting. Are you on an oldschool system? Like a VAX or some sort of mainframe I just edited this example, and it still does it wrongly. blitter.create(400, 0, frameHotdog).setTint(0x0000ff); makes it red. I use 3.22 (not the latest), however the latest version 3.23 still has the same problem. Link to comment Share on other sites More sharing options...
Milton Posted May 25, 2020 Share Posted May 25, 2020 (edited) I'm going crazy. Now it goes wrong for me too What did you do...Well, your solution works, so just reverse the hex for now, and create a github issue. I'll look at it later when I have some time. Or maybe someone on the actual forum (https://phaser.discourse.group/c/phaser3/5) can help you. Edited May 25, 2020 by Milton Link to comment Share on other sites More sharing options...
Darko Posted May 25, 2020 Share Posted May 25, 2020 Hi, just trying to bring some more light if it helps... Another solution I guess: var value = 0xff0000; var color = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16) Looks that this is what it's being applied in the sources... https://github.com/photonstorm/phaser/blob/v3.22.0/src/gameobjects/components/Tint.js Milton 1 Link to comment Share on other sites More sharing options...
Recommended Posts