Vertex Docs

draw()

Description: A Scene represents a single state or screen in your game, such as a main menu, level, or editor view. All rendering logic lives inside the scene’s draw() method, which is automatically called every frame by the GameEngine.

Without a Scene, nothing is drawn and no game logic can run. Every Vertex game must have at least one active scene.

Example: Usage

from VertexEngine.scenes import Scene

class Main(Scene):
    def __init__(self, engine):
        super().__init__(engine)

    def draw(self, surface):
        # Put all drawing code here
        # Example: draw images, shapes, UI, etc.
        pass

Scene Lifecycle

Parameters

Returns

None. The scene renders directly to the screen each frame.

Notes