offsetForSize

fun offsetForSize(width: Double, height: Double, result: Vec2): Vec2

Returns this offset's absolute X and Y coordinates in pixels for a rectangle of a specified size in pixels. The returned offset is in pixels relative to the rectangle's origin, and is defined in the coordinate system used by the caller.

Return

the result argument set to the computed offset

Parameters

width

the rectangle's width in pixels

height

the rectangles height in pixels

result

a pre-allocated Vec2 in which to return the computed offset relative to the rectangle's origin