simvx.graphics.ui.ui_pass

Orthographic 2D pass with dynamic vertex batching for UI elements.

Module Contents

Classes

UIPass

Renders 2D quads and text using an orthographic projection.

TextButton

Simple clickable text region for UI interaction.

Data

API

simvx.graphics.ui.ui_pass.__all__

[‘UIPass’, ‘TextButton’]

simvx.graphics.ui.ui_pass.UI_VERTEX_DTYPE

‘dtype(…)’

simvx.graphics.ui.ui_pass.MAX_UI_VERTICES

4096

simvx.graphics.ui.ui_pass.GLYPH_WIDTH

6

simvx.graphics.ui.ui_pass.GLYPH_HEIGHT

8

simvx.graphics.ui.ui_pass.PIXEL_SCALE

3

class simvx.graphics.ui.ui_pass.UIPass(device: Any, physical_device: Any, extent: tuple[int, int])

Renders 2D quads and text using an orthographic projection.

Initialization

create(pipeline: Any, pipeline_layout: Any, vb: tuple[Any, Any] | None = None) None

Initialize with pre-created pipeline. Optionally pass (buffer, memory) tuple.

begin_batch() None

Start a new UI draw batch.

add_quad(x: float, y: float, w: float, h: float, color: tuple[float, ...] | numpy.ndarray = (1.0, 1.0, 1.0, 1.0)) None

Add a colored quad to the batch (2 triangles = 6 vertices).

add_text(text: str, x: float, y: float, color: tuple[float, ...] | numpy.ndarray = (1.0, 1.0, 1.0, 1.0)) None

Render text using block-style glyphs.

flush(cmd: Any) None

Upload and draw the current batch.

resize(extent: tuple[int, int]) None
destroy() None
class simvx.graphics.ui.ui_pass.TextButton(text: str, x: float, y: float)

Simple clickable text region for UI interaction.

Initialization

contains(mx: float, my: float) bool