ForgeableSum Posted December 19, 2016 Share Posted December 19, 2016 I know it's a long shot, but is there any way to shift the hue of an image without using bitmapdata objects? Since it's possible in CSS, i thought it might be possible to do natively with javascript code. Or, perhaps, using CSS filters, you could shift the hue of an image and load it into the game - with the css filter applied? The problem with using BMDs is that they are just soooo resource-intensive. Your essentially creating a whole new canvas element each time you create one. Link to comment Share on other sites More sharing options...
Fatalist Posted December 19, 2016 Share Posted December 19, 2016 In WebGL renderer - tint does not use a BitmapData. Or use ColorMatrixFilter if you need a bit different effect. In canvas renderer - there is no other way. Link to comment Share on other sites More sharing options...
ForgeableSum Posted December 19, 2016 Author Share Posted December 19, 2016 tint doesn't get the job done (i thought someone would suggest that) as it does not produce an hue shift. I hadn't considered using filters ... it's definitely an option. p.s. I'm pretty sure tint is a canvas feature as well. Link to comment Share on other sites More sharing options...
Fatalist Posted December 19, 2016 Share Posted December 19, 2016 27 minutes ago, feudalwars said: I'm pretty sure tint is a canvas feature as well. Yeah, I mean tint creates a new canvas element in CanvasRenderer, no other way do it. Link to comment Share on other sites More sharing options...
ForgeableSum Posted December 19, 2016 Author Share Posted December 19, 2016 Just now, Fatalist said: Yeah, I mean tint creates a new canvas element in CanvasRenderer, no other way do it. i had no idea. i imagine that tinting lots of sprites has a big impact on performance then? Link to comment Share on other sites More sharing options...
Fatalist Posted December 19, 2016 Share Posted December 19, 2016 2 hours ago, feudalwars said: i imagine that tinting lots of sprites has a big impact on performance then? Yes, but it's a one-time cost, then it gets cached if you don't change the tint. Link to comment Share on other sites More sharing options...
Recommended Posts