dxGetMaterialSize | Multi Theft Auto: Wiki Skip to content

dxGetMaterialSize

Client-side
Server-side
Shared

This gets the dimensions of the supplied texture element.

OOP Syntax Help! I don't understand this!

Syntax

int|false, ​int, ​int dxGetMaterialSize ( ​element texture )
Required arguments
  • texture: The texture element whose size is to be gotten.

Returns

Returns two ints representing the width and height in pixels of the texture, or false if an invalid parameter was passed to the function. If the texture is a volume texture, this function will return three ints representing the width, height and depth.

  • int|false: width
  • int: height
  • int: depth

Code Examples

client
local myTexture = dxCreateTexture("man.png")
local width, height = dxGetMaterialSize(myTexture)
outputChatBox("man.png is " .. tostring(width) .. " pixels wide and " .. tostring(height) .. " pixels high")

Changelog

  • 1.3.0-9.04021

    Added third return value for volume textures.