b2dDrawImageQuad

Maps a whole image onto an arbitrary 4-corner quad (flat, no depth).

2D Overlay

Parameters & Returns

Parameters

image Int
x1 Int
y1 Int
x2 Int
y2 Int
x3 Int
y3 Int
x4 Int
y4 Int

Returns

Void

Quick Summary

Maps a whole image onto an arbitrary 4-corner quad (flat, no depth).

Technical Exegesis...

Draws the entire image stretched onto four arbitrary screen corners, given clockwise from the top-left: (x1,y1)=top-left, (x2,y2)=top-right, (x3,y3)=bottom-right, (x4,y4)=bottom-left (UVs 0,0 / 1,0 / 1,1 / 0,1). Because the corners are arbitrary you can skew, rotate and perspective-fake the image - the building block for drawing textured 3D faces with the 2D runtime. Honours b2dSetColor (as a tint) and b2dSetAlpha; ignores scale/rotation/handle (the corners are absolute).

Example

Example.bam
; paint a crate texture onto one face of a spinning cube
b2dDrawImageQuad(crate, sx0,sy0, sx1,sy1, sx2,sy2, sx3,sy3)