cturtle/ui
include "cturtle/ui";
Types
UiRegistry
Native object
beginUpdate infallible
infallible fn beginUpdate() -> bool
endUpdate infallible
infallible fn endUpdate() -> bool
UiSurface
Native object
handle infallible
infallible fn handle() -> int
UiElement
Native object
handle infallible
infallible fn handle() -> int
setWidth infallible
infallible fn setWidth(float value) -> bool
setWidthPercent infallible
infallible fn setWidthPercent(float value) -> bool
setHeight infallible
infallible fn setHeight(float value) -> bool
setHeightPercent infallible
infallible fn setHeightPercent(float value) -> bool
anchor infallible
infallible fn anchor(int edge, int targetEdge, float offset) -> bool
anchorTo infallible
infallible fn anchorTo(
int edge,
UiElement target,
int targetEdge,
float offset) -> bool
clearAnchor infallible
infallible fn clearAnchor(int edge) -> bool
setAlignItems infallible
infallible fn setAlignItems(int value) -> bool
setAlignSelf infallible
infallible fn setAlignSelf(int value) -> bool
setJustifyContent infallible
infallible fn setJustifyContent(int value) -> bool
setGap infallible
infallible fn setGap(float value) -> bool
setFlexGrow infallible
infallible fn setFlexGrow(float value) -> bool
setMargin infallible
infallible fn setMargin(float a, float b, float c, float d) -> bool
setPadding infallible
infallible fn setPadding(float a, float b, float c, float d) -> bool
setLayoutMode infallible
infallible fn setLayoutMode(int value) -> bool
setFill infallible
infallible fn setFill(float r, float g, float b, float a) -> bool
setGradient infallible
infallible fn setGradient(
float r0,
float g0,
float b0,
float a0,
float r1,
float g1,
float b1,
float a1,
bool vertical) -> bool
setBorder infallible
infallible fn setBorder(float width, float r, float g, float b, float a) -> bool
setRadii infallible
infallible fn setRadii(float a, float b, float c, float d) -> bool
setShadow infallible
infallible fn setShadow(
float x,
float y,
float softness,
float spread,
float r,
float g,
float b,
float a) -> bool
setOpacity infallible
infallible fn setOpacity(float value) -> bool
setText infallible
infallible fn setText(string value) -> bool
setNumber infallible
infallible fn setNumber(float value, int decimals) -> bool
setFont infallible
infallible fn setFont(string value) -> bool
setFontSize infallible
infallible fn setFontSize(float value) -> bool
setTextAlign infallible
infallible fn setTextAlign(int horizontal, int vertical) -> bool
setWrap infallible
infallible fn setWrap(bool value) -> bool
setSelectable infallible
infallible fn setSelectable(bool value) -> bool
clearSelectable infallible
infallible fn clearSelectable() -> bool
selectedText infallible
infallible fn selectedText() -> string
setLineHeight infallible
infallible fn setLineHeight(float value) -> bool
setImage infallible
infallible fn setImage(string value) -> bool
setImageFit infallible
infallible fn setImageFit(int value) -> bool
setImageRegion infallible
infallible fn setImageRegion(float x, float y, float width, float height) -> bool
setImageOrientation infallible
infallible fn setImageOrientation(
float rotationDegrees,
bool flipX,
bool flipY) -> bool
setArc infallible
infallible fn setArc(float a, float b, float c, float d) -> bool
setPathData infallible
infallible fn setPathData(string value) -> bool
setSvg infallible
infallible fn setSvg(string value) -> bool
setSvgText infallible
infallible fn setSvgText(string value) -> bool
shapeCount infallible
infallible fn shapeCount() -> int
shape infallible
infallible fn shape(int value) -> VectorShape
shapeNamed infallible
infallible fn shapeNamed(string value) -> VectorShape
shapeIndex infallible
infallible fn shapeIndex(string value) -> int
addShape infallible
infallible fn addShape(string value) -> VectorShape
removeShape infallible
infallible fn removeShape(int value) -> bool
setShapePathData infallible
infallible fn setShapePathData(int index, string data) -> bool
setShapePolyline infallible
infallible fn setShapePolyline(int index, array<float> points, bool closed) -> bool
setOverflow infallible
infallible fn setOverflow(int horizontal, int vertical) -> bool
setInteractive infallible
infallible fn setInteractive(bool value) -> bool
releasePointerCapture infallible
infallible fn releasePointerCapture() -> bool
setWheelScroll infallible
infallible fn setWheelScroll(bool value) -> bool
setTouchScroll infallible
infallible fn setTouchScroll(bool value) -> bool
setCursor infallible
infallible fn setCursor(int value) -> bool
setEventToken infallible
infallible fn setEventToken(int value) -> bool
setVisible infallible
infallible fn setVisible(bool value) -> bool
setLayoutBoundary infallible
infallible fn setLayoutBoundary(string value) -> bool
retryLayout infallible
infallible fn retryLayout() -> bool
layoutStatus infallible
infallible fn layoutStatus() -> int
setObserved infallible
infallible fn setObserved(bool value) -> bool
setScroll infallible
infallible fn setScroll(float x, float y) -> bool
appendChild infallible
infallible fn appendChild(UiElement child) -> bool
appendChildren infallible
infallible fn appendChildren(array<UiElement> children) -> bool
insertChild infallible
infallible fn insertChild(UiElement child, int index) -> bool
reparentChild infallible
infallible fn reparentChild(UiElement child, int index) -> bool
removeChild infallible
infallible fn removeChild(UiElement child) -> bool
moveChild infallible
infallible fn moveChild(int from, int to) -> bool
rect infallible
infallible fn rect(array<float> out) -> bool
scrollInfo infallible
infallible fn scrollInfo(array<float> out) -> bool
transition infallible
infallible fn transition(
int property,
float a,
float b,
float c,
float d,
float duration,
int ease,
bool pingpong) -> bool
cancelTransition infallible
infallible fn cancelTransition(int property) -> bool
spinVector infallible
infallible fn spinVector(float value) -> bool
VectorShape
Native struct
| Field | Type | Writable | Description |
|---|---|---|---|
visible | bool | yes | |
opacity | float | yes | |
fillR | float | yes | |
fillG | float | yes | |
fillB | float | yes | |
fillA | float | yes | |
fillGradient | bool | yes | |
strokeR | float | yes | |
strokeG | float | yes | |
strokeB | float | yes | |
strokeA | float | yes | |
strokeGradient | bool | yes | |
strokeWidth | float | yes | |
evenOdd | bool | yes | |
lineCap | int | yes | |
lineJoin | int | yes | |
a | float | yes | |
b | float | yes | |
c | float | yes | |
d | float | yes | |
e | float | yes | |
f | float | yes |
Functions
uiRegistry infallible
infallible fn uiRegistry() -> UiRegistry
uiElement infallible
infallible fn uiElement(int kind) -> UiElement
uiMountSurface infallible
infallible fn uiMountSurface(
UiRegistry registry,
int kind,
int width,
int height,
UiElement root) -> UiSurface
uiUnmountSurface infallible
infallible fn uiUnmountSurface(UiRegistry registry, UiSurface surface) -> bool
uiSetCockpit infallible
infallible fn uiSetCockpit(UiRegistry registry, UiSurface surface) -> bool
uiCaptureKeyboard infallible
infallible fn uiCaptureKeyboard(UiRegistry registry, bool captured) -> bool
uiSetCloseGuard infallible
infallible fn uiSetCloseGuard(UiRegistry registry, bool guarded) -> bool
uiConfirmClose infallible
infallible fn uiConfirmClose(UiRegistry registry) -> bool
uiWatchTask infallible
infallible fn uiWatchTask(task<void> task, string name)
uiRegisterShortcut infallible
infallible fn uiRegisterShortcut(
UiRegistry registry,
int key,
int modifiers) -> bool
uiUnregisterShortcut infallible
infallible fn uiUnregisterShortcut(
UiRegistry registry,
int key,
int modifiers) -> bool
uiClipboardWrite infallible
infallible fn uiClipboardWrite(UiRegistry registry, string text) -> bool
uiClipboardRequestPaste infallible
infallible fn uiClipboardRequestPaste(UiRegistry registry) -> bool
uiMeasureText infallible
infallible fn uiMeasureText(
UiRegistry registry,
string text,
float fontSize,
float maxWidth,
array<float> out) -> bool
uiMeasureFontText infallible
infallible fn uiMeasureFontText(
UiRegistry registry,
string font,
string text,
float fontSize,
float maxWidth,
array<float> out) -> bool
uiClock infallible
infallible fn uiClock() -> float
uiFrameStats infallible
infallible fn uiFrameStats(array<float> out) -> bool