Drawing

getrenderproperty

Returns the result of indexing the first argument with the given property key.

Syntax

getrenderproperty(object: any, property: any): any

Arguments

NameTypeDescription
objectanyValue to index. With a Drawing object, the RealDrawingObject __index handler is used.
propertyanyProperty key used for indexing. Drawing object properties are string-based.

Returns

NameTypeDescription
propertyValueanyValue returned by indexing object with property, or nil when the Drawing __index handler has no value for that property.

Description

Returns the result of indexing the first argument with the given property key. For Drawing object, this uses the same Drawing property lookup as object[property], so unknown properties and destroyed Drawing objects return nil. the Drawing API registers this API only when the required rendering environment is active is true; when that check is false, the initializer returns before creating these globals.

Call it with 2 parameter(s): object, property. The argument table explains which values are required and which ones only refine the behavior.

It returns propertyValue (any). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Read a Drawing property like direct indexing.

local line = Drawing.new("Line")
line.Thickness = 3

print(getrenderproperty(line, "Thickness"))
print(getrenderproperty(line, "MissingProperty"))