PurpleKingdomGames / tyrian

Elm-inspired Scala UI library.
https://tyrian.indigoengine.io/
MIT License
346 stars 26 forks source link

Consider adding runtime option for rendering mode #264

Open davesmith00000 opened 5 months ago

davesmith00000 commented 5 months ago

This work done in this PR changes the runtime behaviour in favour of pages that are generally idle between user interactions.

In theory, running something like a game should behave as before. However, we could avoid work and guarantee consistent behaviour for pages that will do constant work, by allowing users to tell the runtime to either render when there is activity, or constantly.

This would mean a further departure from the usual Elm interface, as we'd need to introduce something like Indigo's GameConfig to the interface.

davesmith00000 commented 4 months ago

We could also use this config the enable firing tick events into the app for this issue: https://github.com/PurpleKingdomGames/tyrian/issues/201

I guess you'd need to tell it what Msg to emit, or something. That is, if we can't think of a nice way to just using the Sub mechanics.