DxGetMaterialSize: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(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...")
(No difference)

Revision as of 23:27, 13 June 2011

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