DxGetMaterialSize

From Multi Theft Auto: Wiki
Revision as of 23:27, 13 June 2011 by Ccw (talk | contribs) (Created page with "{{Client function}} __NOTOC__ {{New feature|3.0110|1.1| Only available in 1.1 }} This gets the dimensions of the supplied material element. ==Syntax== <syntaxhighlight lang="lua"> int, in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Only available in 1.1 This gets the dimensions of the supplied material element.

Syntax

int, int dxGetMaterialSize ( element material )

Required Arguments

  • material : The material element whose size is to be gotten

Returns

Returns two ints representing the width and height in pixels of the material, or false if an invalid parameter was passed to the function.

Example

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

See Also