dxGetMaterialSize | Multi Theft Auto: Wiki Skip to content

dxGetMaterialSize

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This gets the dimensions of the supplied material element.

OOP Syntax Help! I don't understand this!

Syntax

int,​ int [,​ int] dxGetMaterialSize ( element material )
Required Arguments
  • material: MISSING_PARAM_DESC

Returns

  • int: value1
  • int [: value2
  • int]: value3

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

Code Examples

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