M MY Multiplayer: Wiki
Side
Kind

dxGetMaterialSize

Client

Returns the size of an image in pixels.

int, int dxGetMaterialSize(texture|dui material)

Parameters

NameTypeDescription
materialtexture|duiThe image: a texture, render target, screen source or dui.

Returns

The width and the height. An argument that is not an image raises an error.

Example

local tex = engineCreateTexture("images/map.png")
local w, h = dxGetMaterialSize(tex)
print("map is " .. w .. "x" .. h)

See also