alexzchen Posted April 7, 2020 Share Posted April 7, 2020 hi, in recent days, I am following the website demo to learn the projection plugin, when I convert a TilingSprite to Sprite2D, it will cause an error(uvs is null), but Sprite is ok, is it a bug? const app = new PIXI.Application({ backgroundColor: 0x1099bb }); document.body.appendChild(app.view); const w = app.screen.width / 2; const h = app.screen.height / 2; function createSquare(x, y) { const square = new PIXI.Sprite(PIXI.Texture.WHITE); square.position.set(x, y); square.anchor.set(0.5); return square; } const squares = [ createSquare(w - 150, h - 150), createSquare(w + 150, h - 150), createSquare(w + 150, h + 150), createSquare(w - 150, h + 150), ]; const quad = squares.map((s) => s.position); const tilingSprite = PIXI.TilingSprite.from("examples/assets/flowerTop.png",200,200); tilingSprite.anchor.set(0.5) tilingSprite.convertTo2d(); //convertTo2d,tilingSpite throw an error, Spite is ok app.stage.addChild(tilingSprite); squares.forEach((s) => { app.stage.addChild(s); }); tilingSprite.proj.mapSprite(tilingSprite, quad); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 7, 2020 Share Posted April 7, 2020 (edited) OK, lets see.. pixi-projection is experimental plugin, here: https://github.com/pixijs/pixi-projection . Here's Sprite2d: https://github.com/pixijs/pixi-projection/blob/master/src/proj2d/tiling/TilingSprite2d.ts Here's convertTo2d: https://github.com/pixijs/pixi-projection/blob/master/src/proj2d/sprites/convert.ts Conclusion: its not a bug. Its just no one coded it. it seems that there's no function there for TilingSprite, and I'm too lazy to implement it, you're the first one who needs TilingSprite to be converted, so you have three options: 1. dont use convertion 2. clone the repo, add the case into convertion, build it, use in your project. Maybe even make a PR. 3. wait if I make it .. next month maybe? I dont have much free coding time now for my 10 pixi plugins Edited April 7, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
alexzchen Posted April 8, 2020 Author Share Posted April 8, 2020 I choose the third one. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
alexzchen Posted October 27, 2020 Author Share Posted October 27, 2020 hello,how things going? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 27, 2020 Share Posted October 27, 2020 Thanks for reminder Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 28, 2020 Share Posted October 28, 2020 (edited) Done, 0.3.15, or "dist" folder in repo. Here's changeset: https://github.com/pixijs/pixi-projection/commit/95a53909d7f236409f204f9dcc5b20c7a3308f7b . Edited October 28, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 29, 2020 Share Posted October 29, 2020 @alexzchen Quote Link to comment Share on other sites More sharing options...
alexzchen Posted November 13, 2020 Author Share Posted November 13, 2020 Thanks very much, I will try it later 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.