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.log[source]

‘getLogger(…)’

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])[source]

Renders 2D quads and text using an orthographic projection.

Initialization

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

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

begin_batch() None[source]

Start a new UI draw batch.

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

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

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

Render text using block-style glyphs.

flush(cmd: Any) None[source]

Upload and draw the current batch.

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

Simple clickable text region for UI interaction.

Initialization

contains(mx: float, my: float) bool[source]