getTextureInfo

From Bohemia Interactive Community
Revision as of 00:26, 30 October 2025 by Killzone Kid (talk | contribs)
Hover & click on the images for description

Description

Description:
Return texture information - resolution in pixels (mipmap level 0) and average colour. Multiply the pixel values by pixelW and pixelH to get screen coordinates.
Groups:
System

Syntax

Syntax:
getTextureInfo texture
Parameters:
texture: String - texture path (.paa, .jpg, .ogv)
Return Value:
Array in format [width, height, rgbaAverageColour] where:

Alternative Syntax

Syntax:
getTextureInfo [texture, sizeH, keepAspectRatio]
Parameters:
texture: String - texture path (.paa, .jpg, .ogv)
sizeH: Number - texture height in screen size
keepAspectRatio: (Optional) Boolean - true if texture is set to keep aspect ratio. Default true
Return Value:
Array in format [sizeH, sizeW] - height and width of the texture in screen units.

Examples

Example 1:
getTextureInfo "a3\characters_f\blufor\data\clothing1_co.paa"; // [2048, 2048, [0.458824, 0.427451, 0.34902, 1]]
Example 2:
getTextureInfo ["\A3\UI_f\Data\Logos\arma3_shadow_ca.paa", 0.1, true]; // [0.1,0.15] getTextureInfo ["\A3\UI_f\Data\Logos\arma3_shadow_ca.paa", 0.1, false]; // [0.1,0.2]

Additional Information

See also:
pixelW pixelH getModelInfo supportInfo getObjectType getObjectTextures

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note