Skip to content

ink ​

Roblox UI beyond the instance tree.

Types ​

Primitive type ​

luau
type Primitive = {
	kind: PrimitiveKind,
	bounds: Rect,
	clip: Rect?,
	color: Color3?,
	transparency: number?,
	rotation: number?,
	round: RoundStyle?,
	gradient: GradientStyle?,
	shadow: ShadowStyle?,
	stroke: StrokeStyle?,
	text: string?,
	text_style: TextStyle?,
	text_wrapped: boolean?,
	text_field: TextField?,
	text_field_options: TextFieldOptions?,
	image: string?,
	image_style: ImageStyle?,
	hit_region: HitRegion?,
	hit_region_wheel: boolean?,
}

PrimitiveKind type ​

luau
type PrimitiveKind = "solid" | "text" | "image" | "hit_region" | "text_field"

Composite type ​

luau
type Composite = {
	primitives: { Primitive },
	bounds: Rect,
}

Length type ​

luau
type Length = number | { read fr: number }

TextStyle type ​

luau
type TextStyle = {
	size: number,
	font: Enum.Font,
	max_width: number?,
	align_x: Enum.TextXAlignment?,
}

ImageStyle type ​

luau
type ImageStyle = {
	scale_type: Enum.ScaleType?,
	slice_center: Rect?,
	slice_scale: number?,
	rect_offset: Vector2?,
	rect_size: Vector2?,
	resample: Enum.ResamplerMode?,
	tile_size: UDim2?,
}

RoundStyle type ​

luau
type RoundStyle = {
	top_left: number?,
	top_right: number?,
	bottom_left: number?,
	bottom_right: number?,
}

StrokeStyle type ​

luau
type StrokeStyle = {
	color: Color3?,
	gradient: GradientStyle?,
	mode: Enum.ApplyStrokeMode?,
	thickness: number?,
	transparency: number?,
}

GradientStyle type ​

luau
type GradientStyle = {
	color: ColorSequence?,
	offset_x: number?,
	offset_y: number?,
	rotation: number?,
	scale: number?,
	tile: Enum.GradientTileMode?,
	transparency: NumberSequence?,
	type: Enum.GradientType?,
}

ShadowStyle type ​

luau
type ShadowStyle = {
	color: Color3?,
	inset: boolean?,
	mode: Enum.ApplyShadowMode,
	radius: number?,
	show_behind_parent: boolean?,
	spread_x: number?,
	spread_y: number?,
	transparency: number?,
}

HitRegion type ​

luau
type HitRegion = Composite & {
	state: Enum.GuiState,
	clicked: boolean,
	wheel: number,
	drag: Vector2,
	pointer: Vector2,
	bounds: Rect,
}

HitRegionOptions type ​

luau
type HitRegionOptions = { wheel: boolean? }

TextField type ​

luau
type TextField = Composite & {
	value: string,
	selection_start: number,
	selection_cursor: number,
	focused: boolean,
	changed: boolean,
	submitted: boolean,
	state: Enum.GuiState,
	pending_value: string?,
	pending_selection_start: number?,
	pending_selection_cursor: number?,
	pending_focus: boolean?,
}

TextFieldOptions type ​

luau
type TextFieldOptions = { multiline: boolean?, editable: boolean? }

InputSource type ​

luau
type InputSource = {
	read InputBegan: RBXScriptSignal<InputObject>,
	read InputChanged: RBXScriptSignal<InputObject>,
	read InputEnded: RBXScriptSignal<InputObject>,
}

InputFrame type ​

luau
type InputFrame = {
	pointer: Vector2,
	pointer_delta: Vector2,
	down: boolean,
	pressed: boolean,
	released: boolean,
	wheel: number,
	keys_held: { [Enum.KeyCode]: boolean },
	keys_pressed: { [Enum.KeyCode]: boolean },
}

InputState type ​

luau
type InputState = {
	hit_regions: { Primitive },
	active: HitRegion?,
}

InputCollector type ​

luau
type InputCollector = input_collector.InputCollector

Scope type ​

luau
type Scope = scope.Scope

Context type ​

luau
type Context<T> = context.Context<T>

Units type ​

luau
type Units = units.Units

Renderer type ​

luau
type Renderer = renderer.Renderer

Story type ​

luau
type Story<C = nil> = {
	name: string?,
	summary: string?,
	cleanup: Cleanup?,
	controls: C?,
	render: (properties: StoryProperties<C>) -> Composite,
}

StoryProperties type ​

luau
type StoryProperties<C = nil> = {
	controls: ProcessControls<C>,
	target: GuiObject,
	target_bounds: Rect,
	scope: scope.Scope,
}

Properties ​

ALIGN_START Read Only ​

luau
ink.ALIGN_START: number

Aligns items at the start of bounds.

ALIGN_MID Read Only ​

luau
ink.ALIGN_MID: number

Aligns items at the middle of bounds.

ALIGN_END Read Only ​

luau
ink.ALIGN_END: number

Aligns items at the end of bounds.

version ​

luau
ink.version: version

solid Module ​

luau
ink.solid: solid

text Module ​

luau
ink.text: text

image Module ​

luau
ink.image: image

map_primitives Module ​

luau
ink.map_primitives: map_primitives

hit_region Module ​

luau
ink.hit_region: hit_region

text_field Module ​

luau
ink.text_field: text_field

resolve_input Module ​

luau
ink.resolve_input: resolve_input

compose Module ​

luau
ink.compose: compose

translate Module ​

luau
ink.translate: translate

align Module ​

luau
ink.align: align

place Module ​

luau
ink.place: place

stack_layout Module ​

luau
ink.stack_layout: stack_layout

h_stack Module ​

luau
ink.h_stack: h_stack

v_stack Module ​

luau
ink.v_stack: v_stack

masonry Module ​

luau
ink.masonry: masonry

visible_range Module ​

luau
ink.visible_range: visible_range

pad Module ​

luau
ink.pad: pad

corners Module ​

luau
ink.corners: corners

edges Module ​

luau
ink.edges: edges

clip Module ​

luau
ink.clip: clip

units Read Only from units ​

luau
ink.units

The current scale.

tint Module ​

luau
ink.tint: tint

rotate Module ​

luau
ink.rotate: rotate

round Module ​

luau
ink.round: round

stroke Module ​

luau
ink.stroke: stroke

gradient Module ​

luau
ink.gradient: gradient

shadow Module ​

luau
ink.shadow: shadow

rect Module ​

luau
ink.rect: rect

rect_sized Module ​

luau
ink.rect_sized: rect_sized

rect_squared Module ​

luau
ink.rect_squared: rect_squared

inset_rect Module ​

luau
ink.inset_rect: inset_rect

union_rects Module ​

luau
ink.union_rects: union_rects

intersect_rects Module ​

luau
ink.intersect_rects: intersect_rects

is_equal_rects Module ​

luau
ink.is_equal_rects: is_equal_rects

is_in_rect Module ​

luau
ink.is_in_rect: is_in_rect

aspect_fit Module ​

luau
ink.aspect_fit: aspect_fit

aspect_cover Module ​

luau
ink.aspect_cover: aspect_cover

distribute Module ​

luau
ink.distribute: distribute

color Module ​

luau
ink.color: color

lerp Module ​

luau
ink.lerp: lerp

tween Module ​

luau
ink.tween: tween

spring Module ​

luau
ink.spring: spring

timer Module ​

luau
ink.timer: timer

after Module ​

luau
ink.after: after

every Module ​

luau
ink.every: every

expensive Module ​

luau
ink.expensive: expensive

async Module ​

luau
ink.async: async

destroy_methods Read Only from destruction ​

luau
ink.destroy_methods: { string }

destroy_types Read Only from destruction ​

luau
ink.destroy_types: { [string]: (any) -> () }

mount Module ​

luau
ink.mount: mount

ui_labs_story Module ​

luau
ink.ui_labs_story: ui_labs_story

hoarcekat_story Module ​

luau
ink.hoarcekat_story: hoarcekat_story

log Module ​

luau
ink.log: log

Functions ​

input_collector from input_collector ​

luau
ink.input_collector(source: types.InputSource, to_local: (Vector2) -> Vector2): InputCollector

px from units ​

luau
ink.px(s: types.Scope, n: number): number

Returns a design-time pixel value, rounded to a whole pixel.

rem from units ​

luau
ink.rem(s: types.Scope, n: number): number

Returns a multiple of the base size, scaled and rounded.

viewport_scale from units ​

luau
ink.viewport_scale(viewport: Rect, reference_height: number, min: number?, max: number?): number

Returns a scale from the viewport height relative to a reference height.

scope from scope ​

luau
ink.scope(): Scope

Returns a new scope.

context from context ​

luau
ink.context<T>(default: T): Context<T>

Returns a new context with the default value.

destroy from destruction ​

luau
ink.destroy(x)

renderer from renderer ​

luau
ink.renderer(root: Instance): Renderer