Overview
Philosophy and Principles
These ideas show up again and again in the components.
Separate logic from visuals
Components are built so that interaction logic does not depend on specific visuals. This keeps them engine agnostic and makes it easier to reskin or redesign without touching core behavior.
Avoid duplicated data
We try to minimize the number of places where data needs to be set or kept in sync.
For example, if a view model has:
items, a list of view modelsselectedItemIndex, a number
That is usually enough to infer the selected item. We avoid adding extra fields like selectedViewModel unless there is a strong reason to. Fewer sources of truth usually means fewer bugs.
Treat components as an internal detail
Ideally, the runtime side of your game should not care about individual UI components.
Instead of engineers pulling values out of a slider or toggle, a higher level view model should describe the menu in terms of pure data:
- A number for audio volume
- A boolean for whether subtitles are enabled
- A list of options for difficulty
Which components represent those values and how they are animated is something designers can control inside Rive. From the engine point of view, these components become an internal implementation detail.