jd557 / interim Goto Github PK
View Code? Open in Web Editor NEWImmediate mode GUI in pure Scala
License: MIT License
Immediate mode GUI in pure Scala
License: MIT License
It would be nice to have some way to center a Rect
in an area, for example, to center a button on a screen.
I'm not entirely sure how the API could look like, this could either be a new layout or just a feature of Rect
.
Imagine a situation like this
Even though the window calls UiContext.registerItem(id, windowArea, passive = true)
, this only stops the input if the window is defined first, as in:
onTop(window(...))
button(...)
However, it's much more natural to do the opposite:
button(...)
window(...)
While I think it should be possible to address the button click, the hot button is unfixable with the current model (as, by the time the window code runs, the button already decided that it's hot).
One alternative that can be explored is to delay everything by one frame, namely:
UiContext
keeps both the hot/active/selected state and a scratch stateregisterItem
updates the scratch state and returns the ItemStatus
based on the current stateUiContext
updates the state with the content of the scratchIt's possible that I'm missing some obvious issue with this approach, but I think with this the components would never see invalid intermediate values of InputStatus
.
MicroUI has 4 types of operation:
InterIm already supports text
and rectangle
, and I think icons are better served by a custom
element.
However, there's still the question of clipping, which is required for smooth scrolling inside a box.
I'm not much of a fan of having this as a RenderOp
, as it adds some extra complexity to the interpreter - as some backends might not support this natively and it requires keeping some state.
I think it might be viable to move that state logic to the UIState
so that:
I'm not sure if I should also add a clip rect to chars, or if I should just keep it simple... maybe I'll add it anyway and let the backend sort that out.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.