ifTextureRequest

Interface for managing texture requests with async, size, and scaling options

Implemented by

NameDescription
roTextureRequestAn roTextureRequest is used to make requests to the roTextureManager

Supported methods

GetId() as Integer

Description

Returns a unique id for the request.

Parameters

The unique ID.

GetState() as Integer

Description

Returns the state of the request.

Return Value

The state value, which may be one of the following:

ValueState
0Requested
1Downloading
2Downloaded
3Ready
4Failed
5Cancelled

SetAsync(async as Boolean) as Void

Description

Sets the request to be either asynchronous (true) or synchronous (false). The default is asynchronous

Parameters

NameTypeDescription
asyncBooleanThe method used to send the request: asynchronous (true) or synchronous (false).

SetSize(width as Integer, height as Integer) as Void

Description

Sets the desired size of the roBitmap. The default is to return a bitmap in its native size.

Parameters

NameTypeDescription
widthIntegerThe width of the roBitmap.
heightIntegerThe height of the roBitmap.

SetScaleMode(mode as Integer) as Void

Description

Sets the scaling mode to be used.

Parameters

SetDrawable(drawable as Boolean) as Void

Available since Roku OS 16.0.

Description

Specifies whether the ifDraw2D functions may draw to and modify the roBitmap returned by the request.

Bitmaps are not drawable by default. The Clear() and Draw() functions on the returned roBitmap return false, indicating failure, unless SetDrawable(true) has been called on the texture request.

Non-drawable bitmaps can be reused from the texture cache and are loaded into texture memory only once, even when multiple requests are made for the same bitmap. Each drawable bitmap gets its own unique copy of the bitmap in texture memory.

Bitmaps created with CreateObject("roBitmap", ...) are always drawable and are unaffected by this function.

Parameters

NameTypeDescription
drawableBooleanWhether the ifDraw2D functions may draw to and modify the returned roBitmap.

Did this page help you?