Documentation Index
Fetch the complete documentation index at: https://rive-accessibility.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
A scripted Layout which can function just like a Node but
also has the ability to fit into a layout box provided via
resize. It can also be intrinsically sized allowing hosting
layouts to attempt to fit to its size by using the measure
function to report desired dimensions.
For more information, see Layout Scripts.
Methods
measure
measure(self: T) -> Vector
When provided this Layout can be intrinsically sized/request
to be a specific size. This is not guaranteed as the layout
may have min/max dimensions. Resize will be called with the
granted size after being measured.
-- Measure the computed size of the layout on resize
function measure(self: MyLayout): Vector
return Vector.xy(100, 100)
end
resize
resize(self: T, size: Vector) -> ()
Guaranteed to be called to set initial size and also called
whenever the size changes.
-- Called when the layout resizes based on the content
-- This only applies to Layouts with a fit type of Hug
function resize(self: MyLayout, size: Vector)
print('Resize:', size)
end