Skip to content

luxe: ui/image.control


import "luxe: ui/image.control" for Data

no docs found

var image : Asset = null
var color : Color = [1, 1, 1, 1]
var angle : Num = 0
var pixelated : Bool = false
var fit : UIImageFit = UIImageFit.fill
var uv : Float4 = [0, 0, 1, 1]
var material : Asset = null
import "luxe: ui/image.control" for UIImage

UIImage is a type of Control made to display images.

var image = UIImage.create(ui)
UIImage.set_image(image, Assets.image("path/to/image"))
//setup positioning etc with `Control.___`

UIImage.create(ui_entity : Entity) : UIImage

Create a new UIImage control.

UIImage.set_image(control : UIImage, image : Image) : None

Set image of UIImage control (uses UIImageFlags.none with linear interpolation). Setting an image will reset any set custom material and use an internal material created from the luxe: material_basis/ui_solid basis instead.

UIImage.set_image(control : UIImage, image : Image, flags : UIImageFlags) : None

Set displayed image of UIImage control. The flags determine what sampler is used to read the image. Setting an image will reset any set custom material and use an internal material created from the luxe: material_basis/ui_solid basis instead.

var image = UIImage.create(ui)
UIImage.set_image(image, Assets.image("path/to/image"), UIImageFlags.pixelated)

UIImage.get_image(control : UIImage) : Image

Get currently displayed image of UIImage

UIImage.set_material(control : UIImage, material : Material) : None

Set the material used to render the UIImage. Setting a custom material will reset the controls image, so you need to author that via the inputs on your material.

UIImage.set_uv(control : UIImage, left : Num, top : Num, right : Num, bottom : Num) : None

Set the uv bounds, default is (0, 0, 1, 1). Drawing only top left of the image would be (0.5, 0.5, 1, 1).

UIImage.set_color(control : UIImage, color : Color) : None

Set the tint color of the UIImage. Communicated to the shader via vertex colors.

UIImage.get_color(control : UIImage) : Color

Get the current tint color of the UIImage.

UIImage.set_angle(control : UIImage, degrees : Num) : None

Set the angle of the UIImage control. Note that this will not affect child controls.

UIImage.set_fit(control : UIImage, fit : UIImageFit) : None

Set the fit mode

UIImage.get_fit(control : UIImage) : UIImageFit

Get the fit mode

import "luxe: ui/image.control" for UIImageFit

no docs found

UIImageFit.fill : unknown

no docs found

UIImageFit.contain : unknown

no docs found

UIImageFit.cover : unknown

no docs found

UIImageFit.keep_width : unknown

no docs found

UIImageFit.keep_height : unknown

no docs found