Skip to content

drawTexture

Draws a texture/image on screen.

TIP

All drawing functions should be called within a render callback/loop.

Syntax

lua
Ham.drawTexture(texture, pos1, pos2, color, rounding, cornerFlags)

Parameters

NameTypeDescription
textureuserdataTexture handle from addCustomTexture
pos1tableTop-left position {x, y}
pos2tableBottom-right position {x, y}
colortableTint color {r, g, b, a} (use white for no tint)
roundingfloatCorner rounding (optional)
cornerFlagstable|integerCorner flags for rounding (optional)

Example

lua
local texture = Ham.addCustomTexture("logo.png", "https://example.com/logo.png")
Ham.drawTexture(texture, {10, 10}, {110, 110}, {255, 255, 255, 255}, 5)

See Also

Released under the ISC License.