memoryBitmap.newTexture()

Type Function
Return value MemoryBitmap
Revision Release 2022.3683
Keywords memoryBitmap, newTexture
See also memoryBitmap.*

Overview

Creates a MemoryBitmap object which allows you to access an in-memory texture.

Created textures are subject to manual texture memory management. See the Texture Loading/Management guide for more information.

Syntax

memoryBitmap.newTexture( params )
params (required)

Table. Table containing the required parameters for the new object — see the next section for details.

Parameter Reference

width (required)

Number. Pixel width of the new bitmap. Note that some systems require bitmap widths to be divisible by 4 in order to be stored in the GPU. In practice, this means that width should be divisible by 4 if format is "rgb" or "mask".

height (required)

Number. Pixel height of the new bitmap.

format (optional)

String. Pixel format for the new bitmap. This should be one of the following values:

  • "rgba" (default) — 4-channel RGB+A bitmap.
  • "rgb"3-channel RGB bitmap.
  • "mask"1-channel mask bitmap; this can only be used as a mask.