-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sprite from texture not showing up #328
Comments
Not sure why yours isn’t working, but it might be the way you create the actual texture, here’s a working demo: |
https://codepen.io/specy-the-bold/pen/eYeXvdx?editors=0110 Do you know some other feature i could use to get a similar outcome? Im just trying to create my own texture to then use it in a sprite. Alternatively, can i get a reference of the renderer used in the react Pixi stage and then use that to generate the cache? |
Sure you can use the |
Forgot to mention that I'm using class components so I'll have to use ref I guess, I'll see what I can do. Thanks for the help! |
For anyone which might need this in the future, yes the issue was that you can render only a texture that comes from the same renderer. If you want to create your own cache, get the ref of the app from the stage, then use that to generate the textures |
Im using a pixi app to create my own textures (in this case basic rectangles) that i then use in the sprites. Sort of a cache
I previously used canvas and converted it to a URL to then use that url as image of the sprite, but i now wanted to convert that to a pixi app to have more "control" of how i create things
I generate the texture like this:
and use it like this in the react component:
But this doesnt show anything in the stage, its all transparent. I tried to use a normal canvas and the pixi instance i used to create the cache and doing this works:
what could be the issue? i cant find anything in the docs about this
@inlet/react-pixi
version: 6.6.5React
version: 17.0.2ReactDOM
version: 17.0.2PIXI
version: 6.1.3The text was updated successfully, but these errors were encountered: