Link Search Menu Expand Document

Surface

A Surface is a View subclass which displays a single texture on a square.

Constructor

 surface = Surface(bounds)

Arguments

Name Type Description
bounds Bounds The Surface’s bounds.

Returns

Nothing


Methods

Surface:setTexture (asset)

Set the Surface’s texture using an Asset.

The asset parameter can be either an Asset instance or a raw string hash

 Surface:setTexture(asset)

Arguments

Name Type Description
asset Asset An instance of an Asset

Returns

Nothing


Surface:setColor (rgba)

Set the color of a Surface using a set of rgba values between 0 and 1.

E.g. to set the surface to be red and 50% transparent, set this value to {1, 0, 0, 0.5}

 Surface:setColor(rgba)

Arguments

Name Type Description
rgba table A table defining a color value with alpha between 0-1.

Returns

Nothing