Jump to content

User


User
 Share

Recommended Posts

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:
image.png.6d8c3a48dd09753cf0a34843285f5dab.png

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?

Link to comment
Share on other sites

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 by ivan.popelyshev
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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