Sets current scale for 2D overlay images (scaleX/scaleY multipliers, affects image drawing). Takes scaleX (horizontal scale multiplier, 1.0=normal, 2.0=double width, 0.5=half width), scaleY (vertical scale multiplier, 1.0=normal, 2.0=double height, 0.5=half height). Returns nothing. Sets g_currentState.scaleX/scaleY (stores in global state, persists until changed).
Sets current scale for 2D overlay images (scaleX/scaleY multipliers, affects image drawing). Takes scaleX (horizontal scale multiplier, 1.0=normal, 2.0=double width, 0.5=half width), scaleY (vertical scale multiplier, 1.0=normal, 2.0=double height, 0.5=half height). Returns nothing. Sets g_currentState.scaleX/scaleY (stores in global state, persists until changed). Use to resize images (enlarge/shrink sprites without loading multiple sizes), create effects (squash/stretch animation, zoom effects), or aspect ratio adjustment (non-uniform scaling for widescreen/portrait). State behavior: stores scale in state (g_currentState scaleX/scaleY values, affects subsequent image draw commands), persists until changed (remains active across frames until b2dSetScale called again), affects image drawing only (sprites, textures, NOT text or shapes), independent of other state (scale separate from color, alpha, rotation). Use cases: (1) Enlarge sprites (b2dSetScale(2.0, 2.0): draw image at 200% size), (2) Shrink sprites (b2dSetScale(0.5, 0.5): draw image at 50% size), (3) Stretch horizontal (b2dSetScale(1.5, 1.0): widen image 150%), (4) Flip horizontal (b2dSetScale(-1.0, 1.0): mirror image horizontally), (5) Animate scale (b2dSetScale(pulse, pulse): pulsing size effect). Common patterns: set = b2dSetScale(x, y) configure scale; reset = b2dSetScale(1.0, 1.0) restore normal size. Typical values: 1.0, 1.0 normal size (default, no scaling, original dimensions), 2.0, 2.0 double size (200% scale, 4x area), 0.5, 0.5 half size (50% scale, 0.25x area), 1.5, 1.0 stretch horizontal (150% width, normal height), 1.0, 2.0 stretch vertical (normal width, 200% height), -1.0, 1.0 flip horizontal (mirror X axis), 1.0, -1.0 flip vertical (mirror Y axis), 0.0 zero size (invisible, but still processed). Scaling behavior: scales from center (image scaled around center point, NOT top-left corner), affects image dimensions (width = originalWidth * scaleX, height = originalHeight * scaleY), negative scale flips (negative values mirror image on that axis), combined with rotation (scale applied BEFORE rotation in transform order). No clamping: values NOT clamped (any scale value accepted, including negative and zero), zero scale valid (image invisible but still processed, avoid for performance), very large scale OK (>10.0 scales work but may cause artifacts or clipping). Performance: set cost zero (two float assignments, trivial CPU operation), state read every draw (GPU reads scale from transform matrix, minimal cost), safe to change frequently (no GPU sync, instant state change), scaled drawing same cost (GPU scales vertices, no performance difference from normal size). Affects images only: sprites scaled (image drawing commands b2dDrawImage affected), text NOT scaled (text rendering ignores scale state, use font size instead), shapes NOT scaled (rectangle/line drawing ignores scale, use dimension parameters). Related: b2dSetRotation sets image rotation (angle in degrees, combined with scale), b2dSetColor sets RGB color (tints images with color multiply), b2dSetAlpha sets transparency (alpha blending for images).