b2dDrawImageQuadUV

Like b2dDrawImageQuad, but with an explicit (u,v) at each corner (sub-region / atlas mapping).

2D Overlay

Parameters & Returns

Parameters

image Int
x1 Int
y1 Int
u1 Double
v1 Double
x2 Int
y2 Int
u2 Double
v2 Double
x3 Int
y3 Int
u3 Double
v3 Double
x4 Int
y4 Int
u4 Double
v4 Double

Returns

Void

Quick Summary

Like b2dDrawImageQuad, but with an explicit (u,v) at each corner (sub-region / atlas mapping).

Technical Exegesis...

Draws a 4-corner quad textured with an arbitrary SUB-REGION of the image - each corner has its own texture coordinate (u,v), 0..1 across the image. Use it for texture atlases or a loaded model's unwrapped UVs (b2dDrawImageQuad is just this with the corners fixed at 0,0 / 1,0 / 1,1 / 0,1). Flat (no depth); honours b2dSetColor tint + b2dSetAlpha. This is the primitive the .bb3d mesh drawer uses per face. For a depth-tested version use b2dDrawImageQuadDepthUV.

Example

Example.bam
; show the top-left quarter of the image on a quad
b2dDrawImageQuadUV(tex, x1,y1,0.0,0.0, x2,y2,0.5,0.0, x3,y3,0.5,0.5, x4,y4,0.0,0.5)