Vertex Docs

Rendering & Asset Management

This module provides image loading and rendering utilities for Vertex-based applications. It bridges pygame image assets with Qt rendering systems.

⚠️ Some classes in this module are internal-only and not part of the public API. They are documented for reference and debugging purposes only.

AssetManager

Description: The AssetManager is the public API for loading and caching image assets. It ensures images are loaded once and reused efficiently throughout the application.

Responsibilities

Example

assets = AssetManager()

player_img = assets.load_image("player", "assets/player.png")
background = assets.load_image("bg", "assets/bg.png")

Methods

load_image(name, path)

Loads an image from disk and caches it under the given name.

Returns: pygame.Surface or None

get_image(name)

Retrieves a cached image by name.

Returns: pygame.Surface or None

⚠️ Internal Rendering APIs

The following classes are not part of the public API. They are marked as deprecated and may change or be removed without notice.

Use AssetManager instead unless you are extending the engine internals.

QtRenderer (Deprecated)

Description: Converts pygame.Surface objects into Qt-compatible textures using QImage. No OpenGL is required.

This class exists for internal rendering pipelines and engine-level integrations.

Pipeline

  1. Accept a pygame surface
  2. Normalize pixel format
  3. Convert to raw RGBA bytes
  4. Create a deep-copied QImage

Method

create_texture(image_asset)

Converts a pygame-backed image asset into a Qt texture.

Returns: Texture

Texture (Deprecated)

Description: A lightweight wrapper around QImage that exposes width and height metadata.

Properties

Debug Output

<Texture 128x128 (QImage)>

ImageAsset (Deprecated)

Description: A minimal container for a pygame.Surface.

This class exists solely for legacy compatibility and internal abstractions.

Properties

Notes