(sorry if this isn’t the right board to put this on)
Hey all,
I’m in the process of porting the work I’ve done on a game engine over to LibGDX - previously, the rendering was handled by Java2D but I ended up reaching its limits pretty quickly in terms of what I’m trying to achieve. I really only have experience with Java2D (and I am incredibly new to LibGDX) and I’m used to being able to pass around a Graphics2D object between classes so that they may handle their own rendering. Is a similar thing considered the right thing to do in LibGDX?
I mean, say when I were using Java2D, I had a Graphics2D object that I grabbed from a Canvas, and I wanted to use it to render a few things that were handled by different classes - I’d just pass that object to those classes by reference and let them handle their own drawing.
My question is, is such a practice appropriate in LibGDX? Passing around a SpriteBatch object, for example?
And in this case, what would be the best case if I needed to render shapes and text as well as sprites in one of these classes?
Thank you all.