Skip to content

Api > Texture2D > Resize()


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

Resizes the texture.

Parameters:⚓︎

Name Type Description
width number width
height number height
format TextureFormat format
hasMipMap boolean Has MipMap

Returns:⚓︎

type Description
boolean true 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.