Queues image draw command (deferred rendering, applies current state color/alpha/scale/rotation).
Takes imageHandle (image handle from b2dLoadImage, positive integer), x (screen X position in pixels, integer), y (screen Y position in pixels, integer).
Returns nothing.
2D Overlay
Parameters & Returns
Parameters
imageHandleInt
xInt
yInt
Returns
Void
Quick Summary
Queues image draw command (deferred rendering, applies current state color/alpha/scale/rotation).
Takes imageHandle (image handle from b2dLoadImage, positive integer), x (screen X position in pixels, integer), y (screen Y position in pixels, integer).
Returns nothing.
Technical Exegesis...
Queues image draw command (deferred rendering, applies current state color/alpha/scale/rotation). Takes imageHandle (image handle from b2dLoadImage, positive integer), x (screen X position in pixels, integer), y (screen Y position in pixels, integer). Returns nothing.
Queues image draw command (deferred rendering, applies current state color/alpha/scale/rotation). Takes imageHandle (image handle from b2dLoadImage, positive integer), x (screen X position in pixels, integer), y (screen Y position in pixels, integer). Returns nothing. Creates draw command (CMD_DRAW_IMAGE type, stores current state snapshot), queues to command buffer (commands executed during b3dRenderWorld), delegates to b2dDrawImageEx(imageHandle, x, y, 0) internally (extended version with shader=0 for default). Use to draw sprites (characters, UI elements, backgrounds), draw textures (icons, buttons, overlays), or composite images (layered rendering). Draw behavior: deferred rendering (command queued not drawn immediately, actual GPU draw happens during b3dRenderWorld), captures state (color, alpha, scale, rotation from g_currentState at queue time), position in pixels (x,y specify top-left corner in screen coordinates 0,0=top-left), cleared each frame (commands cleared by b3dCls3D or automatically at frame end). Use cases: (1) Draw sprite (b2dDrawImage(playerImg, playerX, playerY): render character), (2) Draw UI (b2dDrawImage(buttonImg, 100, 50): draw button), (3) Draw background (b2dDrawImage(bgImg, 0, 0): full-screen background), (4) Draw icon (b2dDrawImage(iconImg, healthX, healthY): HUD icon), (5) Layered rendering (draw background, draw entities, draw UI in order). Common patterns: draw = b2dDrawImage(img, x, y) queue draw; state = b2dSetColor(r,g,b): b2dSetAlpha(a): b2dDrawImage(img, x, y) draw with state. State application: color tint (current RGB multiplied with image pixels, white=no tint), alpha transparency (current alpha blended with image alpha, 1.0=opaque), scale (scaleX/scaleY applied to image dimensions, 1.0=normal size), rotation (angle applied around image center, 0=no rotation). Transform behavior: position is top-left (x,y specify top-left corner before transforms), scale from center (image scaled around center point, NOT top-left), rotation from center (image rotated around center point, NOT top-left), transform order (scale->rotation->position in GPU transform matrix). Deferred rendering: commands queued (stored in draw command buffer, not executed immediately), executed during b3dRenderWorld (all queued commands rendered in order), cleared automatically (commands cleared for next frame after rendering or by b3dCls3D). Performance: queue cost minimal (command structure creation and vector push, ~0.001ms per draw), actual draw cost GPU (depends on image size and shader, ~0.01-0.1ms per image), batching automatic (engine may batch similar draws for efficiency). Validation: ignores if imageHandle invalid (handle not found in g_images map, silently skips draw), position can be negative or offscreen (off-screen images clipped automatically by GPU), no bounds checking (responsibility on user to position images correctly). Related: b2dDrawImageEx extended version (same function with per-draw shader parameter), b2dDrawAnimImage draws animation frame (selects frame from sprite sheet), b2dLoadImage loads image (creates image drawn by this function), b2dSetColor sets draw color (tints image), b2dSetAlpha sets transparency (blends image), b2dSetScale sets image scale (resize), b2dSetRotation sets rotation angle (rotate image).