Problem
The generated C# SDK's DrawQuad(x, y, w, h) and DrawSprite(x, y, w, h) use (x, y) as the center of the shape (confirmed in model_matrix — x/y are the translation in the transform matrix). This is undocumented and causes recurring hitbox mismatches when consumers assume top-left origin.
In Throne, we had to build a SceneUI helper that converts top-left coordinates to center coordinates before calling DrawQuad/DrawSprite. Every interactive element (buttons, hitboxes) was broken because the rendering position and hit-test position used different coordinate origins.
Request
- Document the current behavior clearly in the generated SDK docstrings — specify that
(x, y) is the center of the quad/sprite, not top-left
- Add an optional
CoordinateOrigin enum (Center, TopLeft) parameter or a global config so SDK consumers can choose their convention intentionally
Context
This affects all drawing APIs that take positional parameters:
DrawQuad(x, y, w, h, color)
DrawSprite(textureId, x, y, w, h)
DrawSpriteRect(textureId, x, y, w, h, ...)
DrawText appears to use top-left origin, which adds to the confusion since it differs from DrawQuad/DrawSprite.
Problem
The generated C# SDK's
DrawQuad(x, y, w, h)andDrawSprite(x, y, w, h)use(x, y)as the center of the shape (confirmed inmodel_matrix— x/y are the translation in the transform matrix). This is undocumented and causes recurring hitbox mismatches when consumers assume top-left origin.In Throne, we had to build a
SceneUIhelper that converts top-left coordinates to center coordinates before callingDrawQuad/DrawSprite. Every interactive element (buttons, hitboxes) was broken because the rendering position and hit-test position used different coordinate origins.Request
(x, y)is the center of the quad/sprite, not top-leftCoordinateOriginenum (Center,TopLeft) parameter or a global config so SDK consumers can choose their convention intentionallyContext
This affects all drawing APIs that take positional parameters:
DrawQuad(x, y, w, h, color)DrawSprite(textureId, x, y, w, h)DrawSpriteRect(textureId, x, y, w, h, ...)DrawTextappears to use top-left origin, which adds to the confusion since it differs fromDrawQuad/DrawSprite.