Skip to main content

Texture2D.Resize(number width, number height, TextureFormat format, boolean hasMipMap)

Resizes the texture.

Parameters:

NameTypeDescription
widthnumberwidth
heightnumberheight
formatTextureFormatformat
hasMipMapbooleanHas MipMap

Returns:

typeDescription
booleantrue if operation was successful.

Usage

---@type Texture2D
local texture2d;

---@type number
local width;

---@type number
local height;

---@type TextureFormat
local format;

---@type boolean
local hasMipMap;


local val0 = texture2d.Resize(width, height, format, hasMipMap)

Extra Detail

Changes size of texture to width by height, format to textureFormat and optionally creates mipmaps. After resizing, texture pixels will be undefined. This function is very similar to the texture constructor, except it works on existing texture object.