Can PixiJS be used solely as a rendering engine for use in an Entity Component System architecture? #7205
Unanswered
githubaccount256
asked this question in
Q&A
Replies: 1 comment 4 replies
-
@githubaccount256 my apologies. I migrated this to a discussion because it was a more open-ended question than a specific bug. But now I don't see @SukantPal's responses. I think GitHub borked the converting to Discussions. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, thank you for developing such an amazing library.
I was wondering if Pixi could be used as a more low-level rendering engine. For my game I have developed an ECS. That is, each of my entities is nothing more than a bag of components, and each component is simply a plain old data object of fields. For example, my components look like this:
and my entities look like this:
I then have systems like
RenderSystem
,CollisionSystem
,MovementSystem
which just contain functions that iterate over the relevant entities and draw them, update them, etc.My issue is that PIXI seems perhaps a bit too high level for this, and I'm not sure if there exists anything in the PIXI library to accommodate this need. That is, it seems that PIXI asks you to create
Sprites
, insert them intoContainers
, update the sprite object's x and y properties each game update, etc., but even that is too high level for my purposes.Ideally PIXI could just be used as a rendering engine, and I could avoid the whole high-level process of adding sprites to stages. That is, I could do something like this every frame (pseudocode):
Initially I thought that was what https://pixijs.download/v4.6.1/docs/PIXI.WebGLRenderer.html#render did, but I've tried calling it with several different parameters, and each time the resulting canvas is just blank.
Sorry, this is getting a bit long-winded. Let me be more precise. I have the following questions:
renderer.render
it was blank every time.Beta Was this translation helpful? Give feedback.
All reactions