Queries image height in pixels (returns full texture height, not frame height for anim images).
Takes imageHandle (image handle from b2dLoadImage/b2dLoadAnimImage, positive integer).
Returns height in pixels (positive integer, 0 if handle invalid).
2D Overlay
Parameters & Returns
Parameters
imageHandleInt
Returns
Int
Quick Summary
Queries image height in pixels (returns full texture height, not frame height for anim images).
Takes imageHandle (image handle from b2dLoadImage/b2dLoadAnimImage, positive integer).
Returns height in pixels (positive integer, 0 if handle invalid).
Technical Exegesis...
Queries image height in pixels (returns full texture height, not frame height for anim images). Takes imageHandle (image handle from b2dLoadImage/b2dLoadAnimImage, positive integer). Returns height in pixels (positive integer, 0 if handle invalid). Reads image.height from g_images map (original texture dimensions from file). Use to query dimensions (layout calculations, collision detection, scaling), center images (calculate position offset), or validate sizes (check image loaded correctly).
Queries image height in pixels (returns full texture height, not frame height for anim images). Takes imageHandle (image handle from b2dLoadImage/b2dLoadAnimImage, positive integer). Returns height in pixels (positive integer, 0 if handle invalid). Reads image.height from g_images map (original texture dimensions from file). Use to query dimensions (layout calculations, collision detection, scaling), center images (calculate position offset), or validate sizes (check image loaded correctly). Return behavior: returns height if found (positive integer, original file height), returns 0 if invalid (handle not found in g_images map, invalid handle), read-only query (doesn't modify image, safe to call anytime). Use cases: (1) Center image (y = screenHeight/2 - b2dGetImageHeight(img)/2: center vertically), (2) Bounds check (If mouseY < imgY + b2dGetImageHeight(img) Then inside image), (3) Layout (nextY = y + b2dGetImageHeight(img) + spacing: position next element), (4) Scale (scale = targetHeight / b2dGetImageHeight(img): calculate scale factor). Common patterns: query = h = b2dGetImageHeight(img): use height for calculations; center = y - h/2. Animation sheets: returns full sheet height (NOT frame height, use stored frameHeight for individual frames), example (256x128 sheet with 64x64 frames returns 128, not 64). Performance: query cost zero (map lookup and integer read, trivial CPU operation), safe to call every frame (no GPU cost, read-only operation). Related: b2dGetImageWidth queries width (returns full texture width in pixels), b2dLoadImage loads image (creates image queried by this function), b2dLoadAnimImage loads animation sheet (returns full sheet height, not frame height).