ASMR/src/main/kotlin/net/shadowfacts/cacao
Shadowfacts 8a3be763f1
Tweak window setup order so viewsd have access to screen in View.wasAdded
2019-10-21 11:38:01 -04:00
..
geometry Basic bezier curve rendering 2019-10-21 11:32:18 -04:00
util Basic bezier curve rendering 2019-10-21 11:32:18 -04:00
view Basic bezier curve rendering 2019-10-21 11:32:18 -04:00
viewcontroller Add default ViewController.loadView implementation 2019-08-08 22:10:48 -04:00
CacaoScreen.kt Tweak window setup order so viewsd have access to screen in View.wasAdded 2019-10-21 11:38:01 -04:00
LayoutVariable.kt Add documentation 2019-06-22 16:08:00 -04:00
README.md Update Cacao README 2019-08-08 18:56:06 -04:00
Window.kt Tweak window setup order so viewsd have access to screen in View.wasAdded 2019-10-21 11:38:01 -04:00

README.md

Cacao

Cacao is a UI framework for Fabric/Minecraft mods based on Apple's [Cocoa](https://en.wikipedia.org/wiki/Cocoa_(API) UI toolkit.

Architecture

Screen

A CacaoScreen is the object that acts as the interface between Minecraft GUI code and the Cacao framework.

The CacaoScreen draws Cacao views on screen and passes Minecraft input events to the appropriate Views. The CacaoScreen owns a group of Window objects which are displayed on screen, one on top of the other.

Window

A Window object has a root View Controller that it displays on screen.

The Window occupies the entire screen space and translates events from the screen to the root View Controller's View. It owns a Solver object that manages layout constraints. The window also handles screen resizing and re-lays out the view hierarchy.

View Controller

A ViewController object owns a view, receives lifecycle events for it, and is generally used to control the view.

Each View Controller has a single root View which in turn may have subviews.

View

A View object represents a single view on screen. It handles drawing, positioning, and directly handles input.