Syntax
isrenderobj(object: any): booleanArguments
| Name | Type | Description |
|---|---|---|
object | any | Value to test. Non-object values and object without the Drawing object type return false. |
Returns
| Name | Type | Description |
|---|---|---|
isDrawingObject | boolean | True when the value is object whose methods matches RealDrawingObject; otherwise false. |
Description
Returns whether the value is object with the Drawing object type. This is a methods check only; it does not check whether the underlying Drawing object is still active, tracked, or destroyed. 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 1 parameter(s): object. The argument table explains which values are required and which ones only refine the behavior.
It returns isDrawingObject (boolean). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Check whether a value has Real's Drawing userdata metatable.
local square = Drawing.new("Square")
print(isrenderobj(square))
square:Destroy()
print(isrenderobj(square))
print(isrenderobj({}))