Skip to content

Search

Documentation

widget_image

The rows an image reads: the part of the picture drawn and how it sits in its box.

Sur cette page

ui · 6 properties · UI

The rows an image reads: the part of the picture drawn and how it sits in its box.

In a scene, widget_image is the node key that applies it. A script reaches each property below as a field on node.widget_image: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.widget_image.get() and node.widget_image.set(table).

Properties

property type default description
alt_text string — Text an image draws in place of a picture that will not load
angle_degrees float 0 How far an image is turned clockwise about angle_origin, in degrees; a turned image keeps square corners
angle_origin vec2 [0.5,0.5] The point an image turns about, as fractions of its box from the top left: [0.5, 0.5] is its middle
fit enum — How an image sits in the box it was given: contain and cover keep its shape, fill stretches, none leaves it its own size, centred. Empty lets the picture decide the box instead One of ``, contain, `cover`, `fill`, `none`.
region vec4 [0,0,0,0] The part of an image drawn, as left, top, width and height in the picture's own pixels, which is how an atlas shows one tile; a zero width or height draws the whole picture. ui.image takes it too
tint color [1,1,1,1] What an image is multiplied by; white draws it as it is