wiseDev Posted July 8, 2016 Share Posted July 8, 2016 I'm interested in migrating a game I'm making to PixiJS. Currently I'm using just HTML5 Canvas. I assume PixiJS has fully compatible methods with HTML5 Canvas, since it's its fallback if WebGL doesn't work. So how I would proceed? For example: Let's say I have a drawText function that uses this: ctx.font ctx.fillStyle ctx.strokeStyle ctx.strokeText ctx.fillText And a drawImg function that uses this: canvas[layer].ctx.drawImage(...) canvas[capa].ctx.globalAlpha So I don't load sprites and toy with them. The sprites are loaded, and then I just draw on screen whatever it's necessary in my main loop. My question, in other words, is: Can I replace my main functions with PixiJS functions, or I would have to re-think the graphics logic of my game? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 8, 2016 Share Posted July 8, 2016 Pixi.js renders the scene graph. You have to compose a set of containers and sprites for it to work. There will be option to use only renderer features later, without scene graph. Quote Link to comment Share on other sites More sharing options...
d13 Posted July 9, 2016 Share Posted July 9, 2016 17 hours ago, wiseDev said: 17 hours ago, wiseDev said: My question, in other words, is: Can I replace my main functions with PixiJS functions, or I would have to re-think the graphics logic of my game? You'll have to re-think your view code. Pixi does all the low-level rendering Canvas/WebGL for you, so programming a Pixi application happens at the much higher level of stateful sprite objects. 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.