User Posted August 23, 2020 Share Posted August 23, 2020 I've been messing around with Pixi and have wondered if there is a way to convert Sprites back to Textures. Basically, I wanted to create a plain blue texture from PIXI.Texture.WHITE, but found that I couldn't tint Textures directly. I then wanted to convert them to Sprites, tint those, and then convert them back to Textures via new PIXI.Texture(<tinted Sprite>), but when trying to render the Container, Pixi threw an exception: I just started using Pixi, so I might've missed something obvious. I would be happy to post code snippets if needed. Everything that I found implied that I shouldn't tint the texture itself, but rather tint it when rendering the scene with sprites; would that be the correct/more efficient way to do it? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 23, 2020 Share Posted August 23, 2020 (edited) you have to use renderTexture and "renderer.render()" method to do that. Yes, "sprite.tint" costs almost nothing whether its a sprite or a particle , its on shader side Texture.WHITE was made exactly for that - use it with tint and it'll give you any color of sprite Edited August 23, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
User Posted August 23, 2020 Author Share Posted August 23, 2020 Thank you for your reply! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.