Skip to content

Api > Texture2D > Constructor


Texture2D(number width, number height, TextureFormat textureFormat = TextureFormat.RGBA32, number mipCount = -1, boolean linear = false)⚓︎

Create a new empty texture.

Parameters:⚓︎

Name Type Description
width number Texture width
height number Texture height
textureFormat TextureFormat Texture Format
mipCount number mip Count
linear boolean Is linear?

Usage⚓︎

---@type number
local width;

---@type number
local height;

---@type TextureFormat
local textureFormat;

---@type number
local mipCount;

---@type boolean
local linear;


local texture2d = Texture2D(width, height, textureFormat, mipCount, linear);