Anyone else find it tricky with dynamic content and layout flow?

Hey all, I’ve been diving deep into using the Solar2D platform, and I’ve run into something that’s got me thinking about how to handle dynamic content and the flow of layouts. As a user, I really like how intuitive things are overall, but I’m stuck on one aspect: managing complex layouts when content is always changing.

To give some context, I’m working on something where the content isn’t static. It updates frequently, and each piece of content has varying lengths, which makes things a bit unpredictable. I find myself constantly adjusting things manually, and it feels like I’m not making the best use of the tools.

One idea that I’ve been exploring is a concept I saw in line maps, where the layout is more fluid and adapts based on the size and placement of each element. Line maps are typically used to measure distance between points with map lines , offering a visual representation that connects locations while maintaining flexibility in design. I was inspired by how line maps allow for a certain flexibility, and it got me thinking that maybe there’s a way to apply a similar approach here. Like, instead of rigidly placing things, the layout could adapt based on the content’s size and position more naturally. Has anyone tried something like this with Solar2D? I feel like there’s some potential to streamline things here, but I’m unsure how to implement this idea fully.

Another thing that comes to mind is layering content in a way that feels seamless, but I’m finding it hard to balance the layout when elements need to shift around each other dynamically. For example, if a block of text expands, it ends up overlapping with the image next to it, and I’m not sure if I’m missing something obvious in the setup. I don’t want to keep manually resizing everything each time the content updates because that feels counterproductive.

I also wonder if I’m approaching the layout strategy in the wrong way entirely. Is there a more automated way within Solar2D to have the layout adjust itself without constantly fiddling with positioning and size adjustments? It’s not that the platform doesn’t allow for flexible layouts, but I feel like I might be overcomplicating something that could be simpler.

I’m sure there’s a better way to handle the dynamic nature of content, especially when dealing with text-heavy layouts. I’ve played around with using anchor points and tried a few different methods, but nothing has quite clicked yet.

Would love to hear if anyone else has faced similar challenges or has found some creative solutions. What’s your approach when dealing with changing content and layouts?

I’m not aware of anybody in the community who’s already tried to put something like this together. It definitely sounds interesting as a long-term library sort of project. I’ve done occasional limited layout stuff, but basically one-off affairs and not as flexible as what you describe.


Random libraries follow. :smiley:


amoeba and SILE implement the “Cassowary” constraint algorithm. The first one is by the same guy who did the UTF-8 library Solar is using, and the latter undergirds a typesetting system. (Also, amoeba does have a Lua implementation: the author calls it a “binding” but from what I can tell it’s just a rewrite of the C version.)

You could possibly get somewhere by keeping some sort of intermediate geometry, converting your positions / sizes / etc. (when they change) to some common scale, then when zooming out (to take your map example), adjusting all the constraints beforehand, evaluate the results, then place everything.


This is a UI layout library that came out fairly recently. Maybe there are ideas to plumb from it.


Doesn’t sound like it, but if a dense packing makes sense you might see how font libraries do it (or this, for a fancier example).


TG is a library I’ve looked at and considered doing something with; the author seems to have an interest in maps and computational geometry generally (random other example). Saw this also while skimming GitHub stars for ideas. I imagine these sorts of “intersects”, “constrains”, etc. operations would be useful in something like you mention.


Didn’t come across them, but I’ve seen examples of using physics to keep the elements of a graph together. I can’t imagine that not getting annoying fast, though. :slightly_smiling_face:


Was looking at and / or reviewing this, this, this, and this, but getting sleepy, so offered without comment. :smiley:

1 Like

I have been using Solar2D since 2013, i created mini games, but most of my work is dynamic content business apps, so I’m not sure if this will help or not

I always use scroll views, I download text and images from Database
I place them in the scroll views dynamically
You can always calculate the object’s width and height and place your upcoming objects below or beside previous objects

I’m not sure if we are talking about the same thing, but it has always worked perfectly for me

Hope this helps.

1 Like