legendaryious Posted February 14, 2020 Share Posted February 14, 2020 Hello ! I want to integrate have my spritesheet based on a Base64 Image. I am not 100% sure how to make it work. I cant make it work. I dont get textures in my spritesheet in the end... sheet = new PIXI.Spritesheet(PIXI.Texture.from("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA...."), { "frames": { "banana.png": { "frame": {"x":513, "y":0, "w":512, "h":512}, "spriteSourceSize": {"x":0,"y":0,"w":512,"h":512}, "sourceSize": {"w":512,"h":512} }, "coin.png": { "frame": {"x":513, "y":513, "w":310, "h":334}, "spriteSourceSize": {"x":0,"y":0,"w":310,"h":334}, "sourceSize": {"w":310,"h":334} }, "strawberry.png": { "frame": {"x":0, "y":0, "w":512, "h":512}, "spriteSourceSize": {"x":0,"y":0,"w":512,"h":512}, "sourceSize": {"w":512,"h":512} }, "wrong.png": { "frame": {"x":0, "y":513, "w":512, "h":512}, "spriteSourceSize": {"x":0,"y":0,"w":512,"h":512}, "sourceSize": {"w":512,"h":512} } }, "meta": { "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA....", "size": {"w": 1026, "h": 1026}, "scale": "1" } }); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 14, 2020 Share Posted February 14, 2020 (edited) Out docs dont have this entry, but: when you use spritesheet manually, you have to call "parse" method: https://github.com/pixijs/pixi.js/blob/1d09bfca1ae1a2fcdcca4c8a80ed59f605abcd76/packages/spritesheet/src/Spritesheet.ts#L167 Because, someone thought that parsing is too slow there and has to be async. It wont be async if its less than 1000 textures though Edited February 14, 2020 by ivan.popelyshev 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.