Game with multiple sections

Recommended Posts

I'm just starting to learn PandaJS and I need to make a drawing game, where the top section has some controls to choose the type of figure, color, etc, and the bottom section is the drawing area (I attached a quick mockup)

I've implemented some interaction with Pixi Graphics to draw the figures but in this moment everything is mixed into a single section, and the drawing starts just where I click the button to choose a figure. I want to be able to click any control from the top section and then start drawing when I click the bottom section. I've tried with containers but I don't really understand them. Which is the best approach for this?

Share this post

Link to post

Share on other sites

Now I have sort of a more complex problem, I need to draw shapes like squares or circles in a way that the user sees what he is drawing. I'm doing this by clearing and drawing again the shape every time the mouse moves to a different point (I don't do this with the pencil mode), but I haven't be able to draw another shape without clearing the one that's already drawn. Also I need to keep track of the shapes I draw, because there are going to be undo and redo options.

Should I create a new Graphics object for each shape or what else can I do?