DxGetMaterialSize

From Multi Theft Auto: Wiki
Revision as of 17:35, 31 August 2011 by Ccw (talk | contribs)
Jump to navigation Jump to search

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