simvx.graphics.draw2d_transform

2D affine transform stack for Draw2D.

Provides push/pop transform composition used by all drawing primitives to support rotated, scaled, and translated coordinate spaces, plus a screen_space() context manager that temporarily disables the active camera transform for HUDs and overlays.

Module Contents

Classes

Draw2DTransformMixin

Mixin providing a 2D affine transform stack for Draw2D.

API

class simvx.graphics.draw2d_transform.Draw2DTransformMixin[source]

Mixin providing a 2D affine transform stack for Draw2D.

classmethod push_transform(a, b, c, d, tx, ty)[source]

Push a 2D affine transform, composing with current.

classmethod pop_transform()[source]

Pop the last transform, restoring the previous one.

classmethod push_identity()[source]

Push current transform and reset to identity (for screen-space drawing).

classmethod screen_space()[source]

Draw in screen space, bypassing the active Camera2D transform.

Pairs with the per-call screen_space=True kwarg on draw_rect / draw_circle / draw_line: use the context manager when several HUD calls share the same scope, the kwarg for a single overlay primitive.

with renderer.screen_space():
    renderer.draw_rect((10, 10), (100, 20), filled=True, ...)
    renderer.draw_text("HP", (12, 12), ...)