with-heart / aoe2-ui

2 stars 0 forks source link

Render static AoE2 UI #6

Closed with-heart closed 5 months ago

with-heart commented 7 months ago

Now that I'm mostly done fucking around with rearranging things in the repo (hopefully), we can start working on the actual app functionality. For this issue, we just want to render the panels as static svg images within the large UI svg.

Since we're using the default game files to start, it'll look like the regular AoE2 UI when finished.

with-heart commented 6 months ago

One of the hard parts about this is that svg (or canvas) doesn't lend itself to z-ordered rendering. There's no such thing as z-index for SVGs which means we have to rely instead of order of rendering: elements rendered later are displayed on top of elements rendered earlier.

The other hard part is the awkwardness of the structure of *panel.json files. Widgets can be nested within other widgets, and any widget can define either:

Essentially what I plan to try first is:

I think this is gonna cause things to become a confusing mess for a bit but that's fine—we can refactor later once we figure out cleaner ways for handling this.