dxGetMaterialSize
Client-side
Server-side
Shared
This gets the dimensions of the supplied texture element.
OOP Syntax Help! I don't understand this!
- Method:texture:getSize(...)
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
Added third return value for volume textures.
See Also
Drawing Functions
- dxConvertPixels
- dxCreateFont
- dxCreateRenderTargetUpdated
- dxCreateScreenSource
- dxCreateShader
- dxCreateTextureUpdated
- dxDrawCircle
- dxDrawImage
- dxDrawImageSection
- dxDrawLine
- dxDrawLine3D
- dxDrawMaterialLine3D
- dxDrawMaterialPrimitive
- dxDrawMaterialPrimitive3D
- dxDrawMaterialSectionLine3D
- dxDrawModel3DNew
- dxDrawPrimitive
- dxDrawPrimitive3D
- dxDrawRectangle
- dxDrawText
- dxDrawWiredSphere
- dxGetBlendMode
- dxGetFontHeight
- dxGetMaterialSize
- dxGetPixelColor
- dxGetPixelsFormat
- dxGetPixelsSize
- dxGetStatusUpdated
- dxGetTextSize
- dxGetTexturePixelsUpdated
- dxGetTextWidth
- dxIsAspectRatioAdjustmentEnabled
- dxSetAspectRatioAdjustmentEnabled
- dxSetBlendMode
- dxSetPixelColor
- dxSetRenderTarget
- dxSetShaderTessellation
- dxSetShaderTransform
- dxSetShaderValue
- dxSetTestMode
- dxSetTextureEdge
- dxSetTexturePixels
- dxUpdateScreenSource