dxGetMaterialSize
Client
Returns the size of an image in pixels.
int, int dxGetMaterialSize(texture|dui material)
Parameters
| Name | Type | Description |
|---|---|---|
| material | texture|dui | The 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)