F15: correct docstring accuracy from adversarial verify pass (#314)
Follow-up to the macro conversion: an adversarial verify pass (one agent per file vs. the C++ implementation + stubs) found 62 content issues; the real ones are fixed here. Callbacks (centralized): - on_click: receives (pos, MouseButton, InputState), not str (8 files). - on_enter/on_exit/on_move (UIBase.h): hover passes only (pos) -- removed the fictional button/action args. - bounds/global_bounds (UIBase.h): mark (tuple, read-only). Signatures / types: - Grid.find_path: document heuristic + weight; get_dijkstra_map: document roots; compute_fov: FOV | int = FOV.BASIC (not the C constant FOV_BASIC) + Returns; at/is_in_fov: document (pos) and (x, y) call forms. - get_metrics: document all 16 returned dict keys (was 8); bresenham: drop the bogus '*' keyword-only separator. - Nullable defaults typed correctly: BSP seed/size, ColorLayer draw_fov/ apply_perspective Color|None, Entity.visible_entities radius int=-1 (None is rejected by the 'i' parser -> see #319). - Type-token fixes: GridView.center -> Vector; GridView.texture -> (None, read-only) (unimplemented, #318); GridPoint.grid_pos -> (tuple, read-only); EntityCollection.find -> Entity | list[Entity] | None; extend RuntimeError; UniformCollection.values -> list[float | tuple | None]. - automation: onScreen (x, y) form documented; scroll notes x is ignored (#317). Also: correct stale AStarPath/DijkstraMap signatures in docs/api-audit-2026-04.md (the bindings were right, the audit table was outdated). Rebaseline the API snapshot golden and regenerate docs/stubs. Code-level bugs surfaced by the pass are filed as #317, #318, #319. Refs #314, #317, #318, #319 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
5725a4f035
commit
eafe65683f
27 changed files with 505 additions and 462 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# McRogueFace API Reference
|
||||
|
||||
*Generated on 2026-06-21 01:18:30*
|
||||
*Generated on 2026-06-21 06:42:31*
|
||||
|
||||
*This documentation was dynamically generated from the compiled module.*
|
||||
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
## Functions
|
||||
|
||||
### `bresenham(start, end, *, include_start=True, include_end=True) -> list[tuple[int, int]]`
|
||||
### `bresenham(start, end, include_start=True, include_end=True) -> list[tuple[int, int]]`
|
||||
|
||||
Compute grid cells along a line using Bresenham's algorithm.
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ Note:
|
|||
|
||||
Get current performance metrics.
|
||||
|
||||
**Returns:** dict: Performance data with keys: frame_time (last frame duration in seconds), avg_frame_time (average frame time), fps (frames per second), draw_calls (number of draw calls), ui_elements (total UI element count), visible_elements (visible element count), current_frame (frame counter), runtime (total runtime in seconds)
|
||||
**Returns:** dict: Performance data with keys: frame_time (last frame duration in seconds), avg_frame_time (average frame time), fps (frames per second), draw_calls (number of draw calls), ui_elements (total UI element count), visible_elements (visible element count), current_frame (frame counter), runtime (total runtime in seconds), grid_render_time (grid rendering time in ms), entity_render_time (entity rendering time in ms), fov_overlay_time (FOV overlay rendering time in ms), python_time (Python script execution time in ms), animation_time (animation processing time in ms), grid_cells_rendered (number of grid cells rendered this frame), entities_rendered (number of entities rendered this frame), total_entities (total entity count across all grids)
|
||||
|
||||
### `lock() -> _LockContext`
|
||||
|
||||
|
|
@ -402,11 +402,11 @@ Attributes:
|
|||
|
||||
**Properties:**
|
||||
- `align`: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `center`: Center position of the arc (Vector).
|
||||
- `color`: Arc fill color (Color).
|
||||
- `end_angle`: Ending angle in degrees (float).
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_pos`: Position in grid tile coordinates (Vector, only when parent is Grid).
|
||||
- `grid_size`: Size in grid tile coordinates (Vector, only when parent is Grid).
|
||||
|
|
@ -414,10 +414,10 @@ Attributes:
|
|||
- `hovered` *(read-only)*: Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.
|
||||
- `margin`: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).
|
||||
- `name`: Name for finding this element (str).
|
||||
- `on_click`: Callable executed when arc is clicked. Function receives (pos: Vector, button: str, action: str).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_click`: Callable executed when arc is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `origin`: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.
|
||||
- `parent`: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.
|
||||
|
|
@ -583,14 +583,16 @@ Remove all children, keeping only the root node with original bounds. WARNING: I
|
|||
|
||||
**Returns:** BSP: self, for method chaining
|
||||
|
||||
#### `find(pos: tuple[int, int]) -> BSPNode | None`
|
||||
#### `find(pos: tuple[int, int] | list | Vector) -> BSPNode | None`
|
||||
|
||||
Find the smallest (deepest) node containing the position.
|
||||
|
||||
Note:
|
||||
|
||||
**Arguments:**
|
||||
- `pos`: Position as (x, y) tuple, list, or Vector
|
||||
|
||||
**Returns:** BSPNode if found, None if position is outside bounds
|
||||
**Returns:** BSPNode if found, None if position is outside bounds Also accepts two separate int arguments: find(x, y)
|
||||
|
||||
#### `get_leaf(index: int) -> BSPNode`
|
||||
|
||||
|
|
@ -619,7 +621,7 @@ Split the root node once at the specified position. horizontal=True creates a ho
|
|||
|
||||
**Returns:** BSP: self, for method chaining
|
||||
|
||||
#### `split_recursive(depth: int, min_size: tuple[int, int], max_ratio: float = 1.5, seed: int = None) -> BSP`
|
||||
#### `split_recursive(depth: int, min_size: tuple[int, int], max_ratio: float = 1.5, seed: int | None = None) -> BSP`
|
||||
|
||||
Recursively split to the specified depth. WARNING: Invalidates all existing BSPNode references from this tree.
|
||||
|
||||
|
|
@ -631,7 +633,7 @@ Recursively split to the specified depth. WARNING: Invalidates all existing BSPN
|
|||
|
||||
**Returns:** BSP: self, for method chaining
|
||||
|
||||
#### `to_heightmap(size: tuple[int, int] = None, select: str = 'leaves', shrink: int = 0, value: float = 1.0) -> HeightMap`
|
||||
#### `to_heightmap(size: tuple[int, int] | None = None, select: str = 'leaves', shrink: int = 0, value: float = 1.0) -> HeightMap`
|
||||
|
||||
Convert BSP node selection to a HeightMap.
|
||||
|
||||
|
|
@ -867,10 +869,10 @@ Attributes:
|
|||
|
||||
**Properties:**
|
||||
- `align`: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `fill_color`: Fill color of the text (Color). Returns a copy; modifying components requires reassignment. For animation, use 'fill_color.r', 'fill_color.g', etc.
|
||||
- `font_size`: Font size in points (int). Clamped to the range [0, 65535].
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_pos`: Position in grid tile coordinates (Vector). Only valid when parent is a Grid.
|
||||
- `grid_size`: Size in grid tile coordinates (Vector). Only valid when parent is a Grid.
|
||||
|
|
@ -879,10 +881,10 @@ Attributes:
|
|||
- `hovered` *(read-only)*: Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.
|
||||
- `margin`: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).
|
||||
- `name`: Name for finding elements (str).
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `origin`: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.
|
||||
- `outline`: Thickness of the text outline border (float). Clamped to non-negative values.
|
||||
|
|
@ -997,10 +999,10 @@ Attributes:
|
|||
|
||||
**Properties:**
|
||||
- `align`: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `center`: Center position of the circle (Vector).
|
||||
- `fill_color`: Fill color of the circle (Color).
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_pos`: Position in grid tile coordinates (Vector). Only meaningful when parent is a Grid.
|
||||
- `grid_size`: Size in grid tile coordinates (Vector). Only meaningful when parent is a Grid.
|
||||
|
|
@ -1008,10 +1010,10 @@ Attributes:
|
|||
- `hovered` *(read-only)*: Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.
|
||||
- `margin`: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).
|
||||
- `name`: Name for finding this element (str).
|
||||
- `on_click`: Callable executed when circle is clicked (Callable | None). Function receives (pos: Vector, button: str, action: str).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_click`: Callable executed when circle is clicked (Callable | None). Function receives (pos: Vector, button: MouseButton, action: InputState).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `origin`: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.
|
||||
- `outline`: Outline thickness in pixels (float). Use 0 for no outline.
|
||||
|
|
@ -1207,7 +1209,7 @@ Interpolate between two colors based on HeightMap value within a range. Uses the
|
|||
|
||||
**Returns:** self for method chaining
|
||||
|
||||
#### `apply_perspective(entity: Entity, visible: Color = None, discovered: Color = None, unknown: Color = None) -> None`
|
||||
#### `apply_perspective(entity: Entity, visible: Color | None = None, discovered: Color | None = None, unknown: Color | None = None) -> None`
|
||||
|
||||
Bind this layer to an entity for automatic FOV updates. After binding, call update_perspective() when the entity moves.
|
||||
|
||||
|
|
@ -1240,7 +1242,7 @@ Set a fixed color for cells where the HeightMap value falls within a range.
|
|||
|
||||
**Returns:** self for method chaining
|
||||
|
||||
#### `at(pos) or (x: int, y: int) -> Color`
|
||||
#### `at(pos: tuple | Vector) or (x: int, y: int) -> Color`
|
||||
|
||||
Get the color at a cell position.
|
||||
|
||||
|
|
@ -1255,7 +1257,7 @@ Get the color at a cell position.
|
|||
|
||||
Remove the perspective binding from this layer.
|
||||
|
||||
#### `draw_fov(source: tuple, radius: int = None, fov: FOV = None, visible: Color = None, discovered: Color = None, unknown: Color = None) -> None`
|
||||
#### `draw_fov(source: tuple, radius: int | None = None, fov: FOV | None = None, visible: Color | None = None, discovered: Color | None = None, unknown: Color | None = None) -> None`
|
||||
|
||||
Paint cells based on field-of-view visibility from a source position.
|
||||
|
||||
|
|
@ -1657,7 +1659,7 @@ Convert to HeightMap, optionally mapping values to floats.
|
|||
Base class for all drawable UI elements
|
||||
|
||||
**Properties:**
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `visible`: Whether the object is visible (bool). Invisible objects are not rendered or clickable.
|
||||
- `z_index`: Z-order for rendering (lower values rendered first). Automatically triggers scene resort when changed.
|
||||
|
|
@ -1860,7 +1862,7 @@ Create and start an animation on this entity's property.
|
|||
Note:
|
||||
|
||||
**Arguments:**
|
||||
- `property`: Name of the property to animate: 'draw_x', 'draw_y' (tile coords), 'sprite_scale', 'sprite_index'
|
||||
- `property`: Name of the property to animate: 'draw_x', 'draw_y' (tile coords), 'sprite_scale', 'sprite_index', 'sprite_offset_x', 'sprite_offset_y'
|
||||
- `target`: Target value - float, int, or list of int (for sprite frame sequences)
|
||||
- `duration`: Animation duration in seconds
|
||||
- `easing`: Easing function: Easing enum value, string name, or None for linear
|
||||
|
|
@ -1871,7 +1873,7 @@ Note:
|
|||
|
||||
**Returns:** Animation object for monitoring progress
|
||||
|
||||
**Raises:** ValueError: If property name is not valid for Entity (draw_x, draw_y, sprite_scale, sprite_index) Use 'draw_x'/'draw_y' to animate tile coordinates for smooth movement between grid cells. Use list target with loop=True for repeating sprite frame animations.
|
||||
**Raises:** ValueError: If property name is not valid for Entity (draw_x, draw_y, sprite_scale, sprite_index, sprite_offset_x, sprite_offset_y) Use 'draw_x'/'draw_y' to animate tile coordinates for smooth movement between grid cells. Use list target with loop=True for repeating sprite frame animations. 'x' and 'y' are accepted as aliases for 'draw_x' and 'draw_y'.
|
||||
|
||||
#### `at(x: int, y: int) -> GridPoint | None`
|
||||
|
||||
|
|
@ -1987,17 +1989,19 @@ Note:
|
|||
|
||||
**Returns:** None Called automatically when the entity moves if the grid has FOV configured.
|
||||
|
||||
#### `visible_entities(fov=None, radius: int = None) -> list[Entity]`
|
||||
#### `visible_entities(fov=None, radius: int = -1) -> list[Entity]`
|
||||
|
||||
Get list of other entities visible from this entity's position.
|
||||
|
||||
Note:
|
||||
|
||||
**Arguments:**
|
||||
- `fov`: FOV algorithm to use (FOV enum or None to use grid.fov)
|
||||
- `radius`: FOV radius (int or None to use grid.fov_radius)
|
||||
- `radius`: FOV radius as int; omit or pass -1 to use the grid's default fov_radius
|
||||
|
||||
**Returns:** List of Entity objects within field of view, excluding self
|
||||
|
||||
**Raises:** ValueError: If entity is not associated with a grid
|
||||
**Raises:** ValueError: If entity is not associated with a grid radius does not accept None; omit the argument entirely to use the grid default.
|
||||
|
||||
### Entity3D
|
||||
|
||||
|
|
@ -2292,12 +2296,12 @@ Attributes:
|
|||
|
||||
**Properties:**
|
||||
- `align`: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `cache_subtree`: Cache the frame and all children to a render texture for performance (bool). Useful for complex static subtrees.
|
||||
- `children` *(read-only)*: UICollection of child drawable objects rendered on top of this frame (UICollection, read-only).
|
||||
- `clip_children`: Whether to clip child elements to the frame's bounds (bool). Enables render-texture mode when True.
|
||||
- `fill_color`: Fill color of the rectangle (Color). Returns a copy; modifying components requires reassignment. For animation, use 'fill_color.r', 'fill_color.g', etc.
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_pos`: Position in grid tile coordinates (Vector). Only meaningful when this element's parent is a Grid.
|
||||
- `grid_size`: Size in grid tile coordinates (Vector). Only meaningful when this element's parent is a Grid.
|
||||
|
|
@ -2306,10 +2310,10 @@ Attributes:
|
|||
- `hovered` *(read-only)*: Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.
|
||||
- `margin`: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).
|
||||
- `name`: Name for finding elements (str).
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `origin`: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.
|
||||
- `outline`: Thickness of the border in pixels (float).
|
||||
|
|
@ -2412,13 +2416,13 @@ Keyword Args:
|
|||
|
||||
**Properties:**
|
||||
- `align`: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `camera_rotation`: Rotation of grid contents around camera center in degrees (float).
|
||||
- `center`: Camera center point in pixel coordinates (tuple).
|
||||
- `center`: Camera center point in pixel coordinates (Vector).
|
||||
- `center_x`: Camera center X-coordinate in pixel space (float).
|
||||
- `center_y`: Camera center Y-coordinate in pixel space (float).
|
||||
- `fill_color`: Background fill color (Color). Drawn behind all tiles and entities.
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_data`: The underlying grid data object (Grid | None). Used for multi-view scenarios where multiple GridViews share one Grid.
|
||||
- `h`: Visible widget height (float).
|
||||
|
|
@ -2427,9 +2431,9 @@ Keyword Args:
|
|||
- `margin`: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).
|
||||
- `name`: Name for finding elements (str).
|
||||
- `on_click`: Callable executed when object is clicked (Callable | None).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `origin`: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.
|
||||
- `parent`: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.
|
||||
|
|
@ -2437,7 +2441,7 @@ Keyword Args:
|
|||
- `rotate_with_camera`: Whether to rotate visually with parent Grid's camera_rotation (bool). False (default): stay screen-aligned. True: tilt with camera. Only affects children of UIGrid; ignored for other parents.
|
||||
- `rotation`: Rotation angle in degrees (clockwise around origin). Animatable property.
|
||||
- `shader`: Shader for GPU visual effects (Shader or None). When set, the drawable is rendered through the shader program. Set to None to disable shader effects.
|
||||
- `texture` *(read-only)*: Texture used for tile rendering (Texture | None, read-only).
|
||||
- `texture` *(read-only)*: Texture used for tile rendering (None, read-only). Texture return is not yet implemented; always returns None.
|
||||
- `uniforms` *(read-only)*: Collection of shader uniforms (read-only access to collection). Set uniforms via dict-like syntax: drawable.uniforms['name'] = value. Supports float, vec2/3/4 tuples, PropertyBinding, and CallableBinding.
|
||||
- `vert_margin`: Vertical margin override (float, 0 = use general margin). Invalid for horizontally-centered alignments (CENTER_LEFT, CENTER_RIGHT, CENTER).
|
||||
- `visible`: Whether the object is visible (bool). Invisible objects are not rendered or clickable.
|
||||
|
|
@ -2532,13 +2536,13 @@ Keyword Args:
|
|||
|
||||
**Properties:**
|
||||
- `align`: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `camera_rotation`: Rotation of grid contents around camera center in degrees (float).
|
||||
- `center`: Camera center point in pixel coordinates (tuple).
|
||||
- `center`: Camera center point in pixel coordinates (Vector).
|
||||
- `center_x`: Camera center X-coordinate in pixel space (float).
|
||||
- `center_y`: Camera center Y-coordinate in pixel space (float).
|
||||
- `fill_color`: Background fill color (Color). Drawn behind all tiles and entities.
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_data`: The underlying grid data object (Grid | None). Used for multi-view scenarios where multiple GridViews share one Grid.
|
||||
- `h`: Visible widget height (float).
|
||||
|
|
@ -2547,9 +2551,9 @@ Keyword Args:
|
|||
- `margin`: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).
|
||||
- `name`: Name for finding elements (str).
|
||||
- `on_click`: Callable executed when object is clicked (Callable | None).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `origin`: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.
|
||||
- `parent`: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.
|
||||
|
|
@ -2557,7 +2561,7 @@ Keyword Args:
|
|||
- `rotate_with_camera`: Whether to rotate visually with parent Grid's camera_rotation (bool). False (default): stay screen-aligned. True: tilt with camera. Only affects children of UIGrid; ignored for other parents.
|
||||
- `rotation`: Rotation angle in degrees (clockwise around origin). Animatable property.
|
||||
- `shader`: Shader for GPU visual effects (Shader or None). When set, the drawable is rendered through the shader program. Set to None to disable shader effects.
|
||||
- `texture` *(read-only)*: Texture used for tile rendering (Texture | None, read-only).
|
||||
- `texture` *(read-only)*: Texture used for tile rendering (None, read-only). Texture return is not yet implemented; always returns None.
|
||||
- `uniforms` *(read-only)*: Collection of shader uniforms (read-only access to collection). Set uniforms via dict-like syntax: drawable.uniforms['name'] = value. Supports float, vec2/3/4 tuples, PropertyBinding, and CallableBinding.
|
||||
- `vert_margin`: Vertical margin override (float, 0 = use general margin). Invalid for horizontally-centered alignments (CENTER_LEFT, CENTER_RIGHT, CENTER).
|
||||
- `visible`: Whether the object is visible (bool). Invisible objects are not rendered or clickable.
|
||||
|
|
@ -3427,10 +3431,10 @@ Attributes:
|
|||
|
||||
**Properties:**
|
||||
- `align`: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `color`: Line color as a Color object.
|
||||
- `end`: Ending point of the line as a Vector.
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_pos`: Position in grid tile coordinates (Vector, only when parent is Grid).
|
||||
- `grid_size`: Size in grid tile coordinates (Vector, only when parent is Grid).
|
||||
|
|
@ -3438,10 +3442,10 @@ Attributes:
|
|||
- `hovered` *(read-only)*: Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.
|
||||
- `margin`: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).
|
||||
- `name`: Name for finding this element.
|
||||
- `on_click`: Callable executed when line is clicked. Function receives (pos: Vector, button: str, action: str).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_click`: Callable executed when line is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `origin`: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.
|
||||
- `parent`: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.
|
||||
|
|
@ -4264,8 +4268,8 @@ Attributes:
|
|||
|
||||
**Properties:**
|
||||
- `align`: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_pos`: Position in grid tile coordinates (Vector, only when parent is Grid).
|
||||
- `grid_size`: Size in grid tile coordinates (Vector, only when parent is Grid).
|
||||
|
|
@ -4273,10 +4277,10 @@ Attributes:
|
|||
- `hovered` *(read-only)*: Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.
|
||||
- `margin`: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).
|
||||
- `name`: Name for finding elements (str).
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `origin`: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.
|
||||
- `parent`: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.
|
||||
|
|
@ -4508,7 +4512,7 @@ Set a tile index for cells where the HeightMap value falls within a range.
|
|||
|
||||
**Returns:** self for method chaining
|
||||
|
||||
#### `at(pos) or (x: int, y: int) -> int`
|
||||
#### `at(pos: tuple | Vector) or (x: int, y: int) -> int`
|
||||
|
||||
Get the tile index at a cell position. Returns -1 if no tile is set.
|
||||
|
||||
|
|
@ -5169,7 +5173,7 @@ Keyword Args:
|
|||
|
||||
**Properties:**
|
||||
- `bg_color`: Background clear color.
|
||||
- `bounds`: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `bounds` *(read-only)*: Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `camera_pos`: Camera position as (x, y, z) tuple.
|
||||
- `camera_target`: Camera look-at target as (x, y, z) tuple.
|
||||
- `cell_size`: World units per navigation grid cell.
|
||||
|
|
@ -5182,15 +5186,15 @@ Keyword Args:
|
|||
- `fog_far`: Fog end distance.
|
||||
- `fog_near`: Fog start distance.
|
||||
- `fov`: Camera field of view in degrees.
|
||||
- `global_bounds`: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).
|
||||
- `global_bounds` *(read-only)*: Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- `global_position` *(read-only)*: Global screen position (read-only). Calculates absolute position by walking up the parent chain.
|
||||
- `grid_size`: Navigation grid dimensions as (width, depth) tuple.
|
||||
- `h`: Display height in pixels.
|
||||
- `hovered` *(read-only)*: Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `on_click`: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).
|
||||
- `on_enter`: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.
|
||||
- `on_exit`: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.
|
||||
- `on_move`: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.
|
||||
- `opacity`: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].
|
||||
- `parent`: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.
|
||||
- `pos`: Position as Vector (x, y).
|
||||
|
|
|
|||
|
|
@ -660,8 +660,8 @@ NoiseSource(dimensions=2, algorithm='simplex', hurst=0.5, lacunarity=2.0, seed=N
|
|||
|
||||
| Methods | Signature |
|
||||
|---------|-----------|
|
||||
| `walk` | `() -> tuple` |
|
||||
| `peek` | `() -> tuple` |
|
||||
| `walk` | `() -> Vector` |
|
||||
| `peek` | `() -> Vector` |
|
||||
|
||||
Protocols: `len`, `bool`, iteration
|
||||
|
||||
|
|
@ -673,10 +673,10 @@ Protocols: `len`, `bool`, iteration
|
|||
|
||||
| Methods | Signature |
|
||||
|---------|-----------|
|
||||
| `distance` | `(x, y) -> float` |
|
||||
| `path_from` | `(x, y) -> list` |
|
||||
| `step_from` | `(x, y) -> tuple` |
|
||||
| `to_heightmap` | `() -> HeightMap` |
|
||||
| `distance` | `(pos) -> float \| None` |
|
||||
| `path_from` | `(pos) -> AStarPath` |
|
||||
| `step_from` | `(pos) -> Vector \| None` |
|
||||
| `to_heightmap` | `(size=None, unreachable=-1.0) -> HeightMap` |
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
<body>
|
||||
<div class="container">
|
||||
<h1>McRogueFace API Reference</h1>
|
||||
<p><em>Generated on 2026-06-21 01:18:30</em></p>
|
||||
<p><em>Generated on 2026-06-21 06:42:31</em></p>
|
||||
<p><em>This documentation was dynamically generated from the compiled module.</em></p>
|
||||
|
||||
<div class="toc">
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
<h2 id="functions">Functions</h2>
|
||||
|
||||
<div class="method-section">
|
||||
<h3><code class="function-signature">bresenham(start, end, *, include_start=True, include_end=True) -> list[tuple[int, int]]</code></h3>
|
||||
<h3><code class="function-signature">bresenham(start, end, include_start=True, include_end=True) -> list[tuple[int, int]]</code></h3>
|
||||
<p>Compute grid cells along a line using Bresenham's algorithm.
|
||||
|
||||
Note:</p>
|
||||
|
|
@ -244,7 +244,7 @@ Note:</p>
|
|||
<div class="method-section">
|
||||
<h3><code class="function-signature">get_metrics() -> dict</code></h3>
|
||||
<p>Get current performance metrics.</p>
|
||||
<p><span class='returns'>Returns:</span> dict: Performance data with keys: frame_time (last frame duration in seconds), avg_frame_time (average frame time), fps (frames per second), draw_calls (number of draw calls), ui_elements (total UI element count), visible_elements (visible element count), current_frame (frame counter), runtime (total runtime in seconds)</p>
|
||||
<p><span class='returns'>Returns:</span> dict: Performance data with keys: frame_time (last frame duration in seconds), avg_frame_time (average frame time), fps (frames per second), draw_calls (number of draw calls), ui_elements (total UI element count), visible_elements (visible element count), current_frame (frame counter), runtime (total runtime in seconds), grid_render_time (grid rendering time in ms), entity_render_time (entity rendering time in ms), fov_overlay_time (FOV overlay rendering time in ms), python_time (Python script execution time in ms), animation_time (animation processing time in ms), grid_cells_rendered (number of grid cells rendered this frame), entities_rendered (number of entities rendered this frame), total_entities (total entity count across all grids)</p>
|
||||
</div>
|
||||
|
||||
<div class="method-section">
|
||||
|
|
@ -524,11 +524,11 @@ Attributes:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>align</span>: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>center</span>: Center position of the arc (Vector).</li>
|
||||
<li><span class='property-name'>color</span>: Arc fill color (Color).</li>
|
||||
<li><span class='property-name'>end_angle</span>: Ending angle in degrees (float).</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_pos</span>: Position in grid tile coordinates (Vector, only when parent is Grid).</li>
|
||||
<li><span class='property-name'>grid_size</span>: Size in grid tile coordinates (Vector, only when parent is Grid).</li>
|
||||
|
|
@ -536,10 +536,10 @@ Attributes:
|
|||
<li><span class='property-name'>hovered</span> (read-only): Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.</li>
|
||||
<li><span class='property-name'>margin</span>: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).</li>
|
||||
<li><span class='property-name'>name</span>: Name for finding this element (str).</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when arc is clicked. Function receives (pos: Vector, button: str, action: str).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when arc is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>origin</span>: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.</li>
|
||||
<li><span class='property-name'>parent</span>: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.</li>
|
||||
|
|
@ -711,12 +711,14 @@ Example:
|
|||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
<h5><code class="method-name">find(pos: tuple[int, int]) -> BSPNode | None</code></h5>
|
||||
<p>Find the smallest (deepest) node containing the position.</p>
|
||||
<h5><code class="method-name">find(pos: tuple[int, int] | list | Vector) -> BSPNode | None</code></h5>
|
||||
<p>Find the smallest (deepest) node containing the position.
|
||||
|
||||
Note:</p>
|
||||
<div style='margin-left: 20px;'>
|
||||
<div><span class='arg-name'>pos</span>: Position as (x, y) tuple, list, or Vector</div>
|
||||
</div>
|
||||
<p style='margin-left: 20px;'><span class='returns'>Returns:</span> BSPNode if found, None if position is outside bounds</p>
|
||||
<p style='margin-left: 20px;'><span class='returns'>Returns:</span> BSPNode if found, None if position is outside bounds Also accepts two separate int arguments: find(x, y)</p>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
|
|
@ -746,7 +748,7 @@ Example:
|
|||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
<h5><code class="method-name">split_recursive(depth: int, min_size: tuple[int, int], max_ratio: float = 1.5, seed: int = None) -> BSP</code></h5>
|
||||
<h5><code class="method-name">split_recursive(depth: int, min_size: tuple[int, int], max_ratio: float = 1.5, seed: int | None = None) -> BSP</code></h5>
|
||||
<p>Recursively split to the specified depth. WARNING: Invalidates all existing BSPNode references from this tree.</p>
|
||||
<div style='margin-left: 20px;'>
|
||||
<div><span class='arg-name'>depth</span>: Maximum recursion depth (1-16). Creates up to 2^depth leaves.</div>
|
||||
|
|
@ -758,7 +760,7 @@ Example:
|
|||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
<h5><code class="method-name">to_heightmap(size: tuple[int, int] = None, select: str = 'leaves', shrink: int = 0, value: float = 1.0) -> HeightMap</code></h5>
|
||||
<h5><code class="method-name">to_heightmap(size: tuple[int, int] | None = None, select: str = 'leaves', shrink: int = 0, value: float = 1.0) -> HeightMap</code></h5>
|
||||
<p>Convert BSP node selection to a HeightMap.</p>
|
||||
<div style='margin-left: 20px;'>
|
||||
<div><span class='arg-name'>size</span>: Output size (width, height). Default: bounds size.</div>
|
||||
|
|
@ -1002,10 +1004,10 @@ Attributes:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>align</span>: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>fill_color</span>: Fill color of the text (Color). Returns a copy; modifying components requires reassignment. For animation, use 'fill_color.r', 'fill_color.g', etc.</li>
|
||||
<li><span class='property-name'>font_size</span>: Font size in points (int). Clamped to the range [0, 65535].</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_pos</span>: Position in grid tile coordinates (Vector). Only valid when parent is a Grid.</li>
|
||||
<li><span class='property-name'>grid_size</span>: Size in grid tile coordinates (Vector). Only valid when parent is a Grid.</li>
|
||||
|
|
@ -1014,10 +1016,10 @@ Attributes:
|
|||
<li><span class='property-name'>hovered</span> (read-only): Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.</li>
|
||||
<li><span class='property-name'>margin</span>: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).</li>
|
||||
<li><span class='property-name'>name</span>: Name for finding elements (str).</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>origin</span>: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.</li>
|
||||
<li><span class='property-name'>outline</span>: Thickness of the text outline border (float). Clamped to non-negative values.</li>
|
||||
|
|
@ -1134,10 +1136,10 @@ Attributes:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>align</span>: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>center</span>: Center position of the circle (Vector).</li>
|
||||
<li><span class='property-name'>fill_color</span>: Fill color of the circle (Color).</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_pos</span>: Position in grid tile coordinates (Vector). Only meaningful when parent is a Grid.</li>
|
||||
<li><span class='property-name'>grid_size</span>: Size in grid tile coordinates (Vector). Only meaningful when parent is a Grid.</li>
|
||||
|
|
@ -1145,10 +1147,10 @@ Attributes:
|
|||
<li><span class='property-name'>hovered</span> (read-only): Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.</li>
|
||||
<li><span class='property-name'>margin</span>: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).</li>
|
||||
<li><span class='property-name'>name</span>: Name for finding this element (str).</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when circle is clicked (Callable | None). Function receives (pos: Vector, button: str, action: str).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when circle is clicked (Callable | None). Function receives (pos: Vector, button: MouseButton, action: InputState).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>origin</span>: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.</li>
|
||||
<li><span class='property-name'>outline</span>: Outline thickness in pixels (float). Use 0 for no outline.</li>
|
||||
|
|
@ -1348,7 +1350,7 @@ Example:
|
|||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
<h5><code class="method-name">apply_perspective(entity: Entity, visible: Color = None, discovered: Color = None, unknown: Color = None) -> None</code></h5>
|
||||
<h5><code class="method-name">apply_perspective(entity: Entity, visible: Color | None = None, discovered: Color | None = None, unknown: Color | None = None) -> None</code></h5>
|
||||
<p>Bind this layer to an entity for automatic FOV updates. After binding, call update_perspective() when the entity moves.</p>
|
||||
<div style='margin-left: 20px;'>
|
||||
<div><span class='arg-name'>entity</span>: The entity whose perspective to track</div>
|
||||
|
|
@ -1382,7 +1384,7 @@ Note:</p>
|
|||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
<h5><code class="method-name">at(pos) or (x: int, y: int) -> Color</code></h5>
|
||||
<h5><code class="method-name">at(pos: tuple | Vector) or (x: int, y: int) -> Color</code></h5>
|
||||
<p>Get the color at a cell position.</p>
|
||||
<div style='margin-left: 20px;'>
|
||||
<div><span class='arg-name'>pos</span>: Position as (x, y) tuple, list, or Vector; or pass x and y separately</div>
|
||||
|
|
@ -1397,7 +1399,7 @@ Note:</p>
|
|||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
<h5><code class="method-name">draw_fov(source: tuple, radius: int = None, fov: FOV = None, visible: Color = None, discovered: Color = None, unknown: Color = None) -> None</code></h5>
|
||||
<h5><code class="method-name">draw_fov(source: tuple, radius: int | None = None, fov: FOV | None = None, visible: Color | None = None, discovered: Color | None = None, unknown: Color | None = None) -> None</code></h5>
|
||||
<p>Paint cells based on field-of-view visibility from a source position.
|
||||
|
||||
Note:</p>
|
||||
|
|
@ -1802,7 +1804,7 @@ Example:
|
|||
<p>Base class for all drawable UI elements</p>
|
||||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>visible</span>: Whether the object is visible (bool). Invisible objects are not rendered or clickable.</li>
|
||||
<li><span class='property-name'>z_index</span>: Z-order for rendering (lower values rendered first). Automatically triggers scene resort when changed.</li>
|
||||
|
|
@ -2015,7 +2017,7 @@ Attributes:
|
|||
|
||||
Note:</p>
|
||||
<div style='margin-left: 20px;'>
|
||||
<div><span class='arg-name'>property</span>: Name of the property to animate: 'draw_x', 'draw_y' (tile coords), 'sprite_scale', 'sprite_index'</div>
|
||||
<div><span class='arg-name'>property</span>: Name of the property to animate: 'draw_x', 'draw_y' (tile coords), 'sprite_scale', 'sprite_index', 'sprite_offset_x', 'sprite_offset_y'</div>
|
||||
<div><span class='arg-name'>target</span>: Target value - float, int, or list of int (for sprite frame sequences)</div>
|
||||
<div><span class='arg-name'>duration</span>: Animation duration in seconds</div>
|
||||
<div><span class='arg-name'>easing</span>: Easing function: Easing enum value, string name, or None for linear</div>
|
||||
|
|
@ -2025,7 +2027,7 @@ Note:</p>
|
|||
<div><span class='arg-name'>conflict_mode</span>: 'replace' (default), 'queue', or 'error' if property already animating</div>
|
||||
</div>
|
||||
<p style='margin-left: 20px;'><span class='returns'>Returns:</span> Animation object for monitoring progress</p>
|
||||
<p style='margin-left: 20px;'><span class='raises'>Raises:</span> ValueError: If property name is not valid for Entity (draw_x, draw_y, sprite_scale, sprite_index) Use 'draw_x'/'draw_y' to animate tile coordinates for smooth movement between grid cells. Use list target with loop=True for repeating sprite frame animations.</p>
|
||||
<p style='margin-left: 20px;'><span class='raises'>Raises:</span> ValueError: If property name is not valid for Entity (draw_x, draw_y, sprite_scale, sprite_index, sprite_offset_x, sprite_offset_y) Use 'draw_x'/'draw_y' to animate tile coordinates for smooth movement between grid cells. Use list target with loop=True for repeating sprite frame animations. 'x' and 'y' are accepted as aliases for 'draw_x' and 'draw_y'.</p>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
|
|
@ -2142,14 +2144,16 @@ Note:</p>
|
|||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
<h5><code class="method-name">visible_entities(fov=None, radius: int = None) -> list[Entity]</code></h5>
|
||||
<p>Get list of other entities visible from this entity's position.</p>
|
||||
<h5><code class="method-name">visible_entities(fov=None, radius: int = -1) -> list[Entity]</code></h5>
|
||||
<p>Get list of other entities visible from this entity's position.
|
||||
|
||||
Note:</p>
|
||||
<div style='margin-left: 20px;'>
|
||||
<div><span class='arg-name'>fov</span>: FOV algorithm to use (FOV enum or None to use grid.fov)</div>
|
||||
<div><span class='arg-name'>radius</span>: FOV radius (int or None to use grid.fov_radius)</div>
|
||||
<div><span class='arg-name'>radius</span>: FOV radius as int; omit or pass -1 to use the grid's default fov_radius</div>
|
||||
</div>
|
||||
<p style='margin-left: 20px;'><span class='returns'>Returns:</span> List of Entity objects within field of view, excluding self</p>
|
||||
<p style='margin-left: 20px;'><span class='raises'>Raises:</span> ValueError: If entity is not associated with a grid</p>
|
||||
<p style='margin-left: 20px;'><span class='raises'>Raises:</span> ValueError: If entity is not associated with a grid radius does not accept None; omit the argument entirely to use the grid default.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -2468,12 +2472,12 @@ Attributes:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>align</span>: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>cache_subtree</span>: Cache the frame and all children to a render texture for performance (bool). Useful for complex static subtrees.</li>
|
||||
<li><span class='property-name'>children</span> (read-only): UICollection of child drawable objects rendered on top of this frame (UICollection, read-only).</li>
|
||||
<li><span class='property-name'>clip_children</span>: Whether to clip child elements to the frame's bounds (bool). Enables render-texture mode when True.</li>
|
||||
<li><span class='property-name'>fill_color</span>: Fill color of the rectangle (Color). Returns a copy; modifying components requires reassignment. For animation, use 'fill_color.r', 'fill_color.g', etc.</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_pos</span>: Position in grid tile coordinates (Vector). Only meaningful when this element's parent is a Grid.</li>
|
||||
<li><span class='property-name'>grid_size</span>: Size in grid tile coordinates (Vector). Only meaningful when this element's parent is a Grid.</li>
|
||||
|
|
@ -2482,10 +2486,10 @@ Attributes:
|
|||
<li><span class='property-name'>hovered</span> (read-only): Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.</li>
|
||||
<li><span class='property-name'>margin</span>: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).</li>
|
||||
<li><span class='property-name'>name</span>: Name for finding elements (str).</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>origin</span>: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.</li>
|
||||
<li><span class='property-name'>outline</span>: Thickness of the border in pixels (float).</li>
|
||||
|
|
@ -2590,13 +2594,13 @@ Keyword Args:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>align</span>: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>camera_rotation</span>: Rotation of grid contents around camera center in degrees (float).</li>
|
||||
<li><span class='property-name'>center</span>: Camera center point in pixel coordinates (tuple).</li>
|
||||
<li><span class='property-name'>center</span>: Camera center point in pixel coordinates (Vector).</li>
|
||||
<li><span class='property-name'>center_x</span>: Camera center X-coordinate in pixel space (float).</li>
|
||||
<li><span class='property-name'>center_y</span>: Camera center Y-coordinate in pixel space (float).</li>
|
||||
<li><span class='property-name'>fill_color</span>: Background fill color (Color). Drawn behind all tiles and entities.</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_data</span>: The underlying grid data object (Grid | None). Used for multi-view scenarios where multiple GridViews share one Grid.</li>
|
||||
<li><span class='property-name'>h</span>: Visible widget height (float).</li>
|
||||
|
|
@ -2605,9 +2609,9 @@ Keyword Args:
|
|||
<li><span class='property-name'>margin</span>: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).</li>
|
||||
<li><span class='property-name'>name</span>: Name for finding elements (str).</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked (Callable | None).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>origin</span>: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.</li>
|
||||
<li><span class='property-name'>parent</span>: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.</li>
|
||||
|
|
@ -2615,7 +2619,7 @@ Keyword Args:
|
|||
<li><span class='property-name'>rotate_with_camera</span>: Whether to rotate visually with parent Grid's camera_rotation (bool). False (default): stay screen-aligned. True: tilt with camera. Only affects children of UIGrid; ignored for other parents.</li>
|
||||
<li><span class='property-name'>rotation</span>: Rotation angle in degrees (clockwise around origin). Animatable property.</li>
|
||||
<li><span class='property-name'>shader</span>: Shader for GPU visual effects (Shader or None). When set, the drawable is rendered through the shader program. Set to None to disable shader effects.</li>
|
||||
<li><span class='property-name'>texture</span> (read-only): Texture used for tile rendering (Texture | None, read-only).</li>
|
||||
<li><span class='property-name'>texture</span> (read-only): Texture used for tile rendering (None, read-only). Texture return is not yet implemented; always returns None.</li>
|
||||
<li><span class='property-name'>uniforms</span> (read-only): Collection of shader uniforms (read-only access to collection). Set uniforms via dict-like syntax: drawable.uniforms['name'] = value. Supports float, vec2/3/4 tuples, PropertyBinding, and CallableBinding.</li>
|
||||
<li><span class='property-name'>vert_margin</span>: Vertical margin override (float, 0 = use general margin). Invalid for horizontally-centered alignments (CENTER_LEFT, CENTER_RIGHT, CENTER).</li>
|
||||
<li><span class='property-name'>visible</span>: Whether the object is visible (bool). Invisible objects are not rendered or clickable.</li>
|
||||
|
|
@ -2712,13 +2716,13 @@ Keyword Args:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>align</span>: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>camera_rotation</span>: Rotation of grid contents around camera center in degrees (float).</li>
|
||||
<li><span class='property-name'>center</span>: Camera center point in pixel coordinates (tuple).</li>
|
||||
<li><span class='property-name'>center</span>: Camera center point in pixel coordinates (Vector).</li>
|
||||
<li><span class='property-name'>center_x</span>: Camera center X-coordinate in pixel space (float).</li>
|
||||
<li><span class='property-name'>center_y</span>: Camera center Y-coordinate in pixel space (float).</li>
|
||||
<li><span class='property-name'>fill_color</span>: Background fill color (Color). Drawn behind all tiles and entities.</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_data</span>: The underlying grid data object (Grid | None). Used for multi-view scenarios where multiple GridViews share one Grid.</li>
|
||||
<li><span class='property-name'>h</span>: Visible widget height (float).</li>
|
||||
|
|
@ -2727,9 +2731,9 @@ Keyword Args:
|
|||
<li><span class='property-name'>margin</span>: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).</li>
|
||||
<li><span class='property-name'>name</span>: Name for finding elements (str).</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked (Callable | None).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>origin</span>: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.</li>
|
||||
<li><span class='property-name'>parent</span>: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.</li>
|
||||
|
|
@ -2737,7 +2741,7 @@ Keyword Args:
|
|||
<li><span class='property-name'>rotate_with_camera</span>: Whether to rotate visually with parent Grid's camera_rotation (bool). False (default): stay screen-aligned. True: tilt with camera. Only affects children of UIGrid; ignored for other parents.</li>
|
||||
<li><span class='property-name'>rotation</span>: Rotation angle in degrees (clockwise around origin). Animatable property.</li>
|
||||
<li><span class='property-name'>shader</span>: Shader for GPU visual effects (Shader or None). When set, the drawable is rendered through the shader program. Set to None to disable shader effects.</li>
|
||||
<li><span class='property-name'>texture</span> (read-only): Texture used for tile rendering (Texture | None, read-only).</li>
|
||||
<li><span class='property-name'>texture</span> (read-only): Texture used for tile rendering (None, read-only). Texture return is not yet implemented; always returns None.</li>
|
||||
<li><span class='property-name'>uniforms</span> (read-only): Collection of shader uniforms (read-only access to collection). Set uniforms via dict-like syntax: drawable.uniforms['name'] = value. Supports float, vec2/3/4 tuples, PropertyBinding, and CallableBinding.</li>
|
||||
<li><span class='property-name'>vert_margin</span>: Vertical margin override (float, 0 = use general margin). Invalid for horizontally-centered alignments (CENTER_LEFT, CENTER_RIGHT, CENTER).</li>
|
||||
<li><span class='property-name'>visible</span>: Whether the object is visible (bool). Invisible objects are not rendered or clickable.</li>
|
||||
|
|
@ -3625,10 +3629,10 @@ Attributes:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>align</span>: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>color</span>: Line color as a Color object.</li>
|
||||
<li><span class='property-name'>end</span>: Ending point of the line as a Vector.</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_pos</span>: Position in grid tile coordinates (Vector, only when parent is Grid).</li>
|
||||
<li><span class='property-name'>grid_size</span>: Size in grid tile coordinates (Vector, only when parent is Grid).</li>
|
||||
|
|
@ -3636,10 +3640,10 @@ Attributes:
|
|||
<li><span class='property-name'>hovered</span> (read-only): Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.</li>
|
||||
<li><span class='property-name'>margin</span>: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).</li>
|
||||
<li><span class='property-name'>name</span>: Name for finding this element.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when line is clicked. Function receives (pos: Vector, button: str, action: str).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when line is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>origin</span>: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.</li>
|
||||
<li><span class='property-name'>parent</span>: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.</li>
|
||||
|
|
@ -4513,8 +4517,8 @@ Attributes:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>align</span>: Alignment relative to parent bounds (Alignment enum or None). When set, position is automatically calculated when parent is assigned or resized. Set to None to disable alignment and use manual positioning.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_pos</span>: Position in grid tile coordinates (Vector, only when parent is Grid).</li>
|
||||
<li><span class='property-name'>grid_size</span>: Size in grid tile coordinates (Vector, only when parent is Grid).</li>
|
||||
|
|
@ -4522,10 +4526,10 @@ Attributes:
|
|||
<li><span class='property-name'>hovered</span> (read-only): Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.</li>
|
||||
<li><span class='property-name'>margin</span>: General margin from edge when aligned (float). Applied to both horizontal and vertical edges unless overridden. Invalid for CENTER alignment (raises ValueError).</li>
|
||||
<li><span class='property-name'>name</span>: Name for finding elements (str).</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>origin</span>: Transform origin as Vector (pivot point for rotation). Default (0,0) is top-left; set to (w/2, h/2) to rotate around center.</li>
|
||||
<li><span class='property-name'>parent</span>: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.</li>
|
||||
|
|
@ -4760,7 +4764,7 @@ Note:</p>
|
|||
</div>
|
||||
|
||||
<div style="margin-left: 20px; margin-bottom: 15px;">
|
||||
<h5><code class="method-name">at(pos) or (x: int, y: int) -> int</code></h5>
|
||||
<h5><code class="method-name">at(pos: tuple | Vector) or (x: int, y: int) -> int</code></h5>
|
||||
<p>Get the tile index at a cell position. Returns -1 if no tile is set.</p>
|
||||
<div style='margin-left: 20px;'>
|
||||
<div><span class='arg-name'>pos</span>: Position as (x, y) tuple, list, or Vector; or pass x and y separately</div>
|
||||
|
|
@ -5446,7 +5450,7 @@ Keyword Args:
|
|||
<h4>Properties:</h4>
|
||||
<ul>
|
||||
<li><span class='property-name'>bg_color</span>: Background clear color.</li>
|
||||
<li><span class='property-name'>bounds</span>: Bounding box as (pos, size) tuple of Vectors. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>bounds</span> (read-only): Axis-aligned bounding box (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>camera_pos</span>: Camera position as (x, y, z) tuple.</li>
|
||||
<li><span class='property-name'>camera_target</span>: Camera look-at target as (x, y, z) tuple.</li>
|
||||
<li><span class='property-name'>cell_size</span>: World units per navigation grid cell.</li>
|
||||
|
|
@ -5459,15 +5463,15 @@ Keyword Args:
|
|||
<li><span class='property-name'>fog_far</span>: Fog end distance.</li>
|
||||
<li><span class='property-name'>fog_near</span>: Fog start distance.</li>
|
||||
<li><span class='property-name'>fov</span>: Camera field of view in degrees.</li>
|
||||
<li><span class='property-name'>global_bounds</span>: Bounding box as (pos, size) tuple of Vectors in screen coordinates. Returns (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_bounds</span> (read-only): Axis-aligned bounding box in screen coordinates (tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y), Vector(width, height)).</li>
|
||||
<li><span class='property-name'>global_position</span> (read-only): Global screen position (read-only). Calculates absolute position by walking up the parent chain.</li>
|
||||
<li><span class='property-name'>grid_size</span>: Navigation grid dimensions as (width, depth) tuple.</li>
|
||||
<li><span class='property-name'>h</span>: Display height in pixels.</li>
|
||||
<li><span class='property-name'>hovered</span> (read-only): Whether mouse is currently over this element (read-only). Updated automatically by the engine during mouse movement.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: str, action: str).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector, button: str, action: str) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector, button: str, action: str) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector, button: str, action: str) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>on_click</span>: Callable executed when object is clicked. Function receives (pos: Vector, button: MouseButton, action: InputState).</li>
|
||||
<li><span class='property-name'>on_enter</span>: Callback for mouse enter events. Called with (pos: Vector) when mouse enters this element's bounds.</li>
|
||||
<li><span class='property-name'>on_exit</span>: Callback for mouse exit events. Called with (pos: Vector) when mouse leaves this element's bounds.</li>
|
||||
<li><span class='property-name'>on_move</span>: Callback for mouse movement within bounds. Called with (pos: Vector) for each mouse movement while inside. Performance note: Called frequently during movement - keep handlers fast.</li>
|
||||
<li><span class='property-name'>opacity</span>: Opacity level (0.0 = transparent, 1.0 = opaque). Automatically clamped to valid range [0.0, 1.0].</li>
|
||||
<li><span class='property-name'>parent</span>: Parent drawable. Get: Returns the parent Frame/Grid if nested, or None if at scene level. Set: Assign a Frame/Grid to reparent, or None to remove from parent.</li>
|
||||
<li><span class='property-name'>pos</span>: Position as Vector (x, y).</li>
|
||||
|
|
|
|||
282
docs/mcrfpy.3
282
docs/mcrfpy.3
|
|
@ -14,11 +14,11 @@
|
|||
. ftr VB CB
|
||||
. ftr VBI CBI
|
||||
.\}
|
||||
.TH "MCRFPY" "3" "2026-06-21" "McRogueFace 0.2.7-prerelease-7drl2026-103-g39c2340" ""
|
||||
.TH "MCRFPY" "3" "2026-06-21" "McRogueFace 0.2.7-prerelease-7drl2026-104-g5725a4f" ""
|
||||
.hy
|
||||
.SH McRogueFace API Reference
|
||||
.PP
|
||||
\f[I]Generated on 2026-06-21 01:18:30\f[R]
|
||||
\f[I]Generated on 2026-06-21 06:42:31\f[R]
|
||||
.PP
|
||||
\f[I]This documentation was dynamically generated from the compiled
|
||||
module.\f[R]
|
||||
|
|
@ -148,7 +148,7 @@ Window
|
|||
.IP \[bu] 2
|
||||
Constants
|
||||
.SS Functions
|
||||
.SS \f[V]bresenham(start, end, *, include_start=True, include_end=True) -> list[tuple[int, int]]\f[R]
|
||||
.SS \f[V]bresenham(start, end, include_start=True, include_end=True) -> list[tuple[int, int]]\f[R]
|
||||
.PP
|
||||
Compute grid cells along a line using Bresenham\[cq]s algorithm.
|
||||
.PP
|
||||
|
|
@ -213,7 +213,14 @@ Get current performance metrics.
|
|||
frame duration in seconds), avg_frame_time (average frame time), fps
|
||||
(frames per second), draw_calls (number of draw calls), ui_elements
|
||||
(total UI element count), visible_elements (visible element count),
|
||||
current_frame (frame counter), runtime (total runtime in seconds)
|
||||
current_frame (frame counter), runtime (total runtime in seconds),
|
||||
grid_render_time (grid rendering time in ms), entity_render_time (entity
|
||||
rendering time in ms), fov_overlay_time (FOV overlay rendering time in
|
||||
ms), python_time (Python script execution time in ms), animation_time
|
||||
(animation processing time in ms), grid_cells_rendered (number of grid
|
||||
cells rendered this frame), entities_rendered (number of entities
|
||||
rendered this frame), total_entities (total entity count across all
|
||||
grids)
|
||||
.SS \f[V]lock() -> _LockContext\f[R]
|
||||
.PP
|
||||
Get a context manager for thread-safe UI updates from background
|
||||
|
|
@ -478,14 +485,15 @@ bounds (Alignment enum or None).
|
|||
When set, position is automatically calculated when parent is assigned
|
||||
or resized.
|
||||
Set to None to disable alignment and use manual positioning.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]center\f[R]: Center position of the arc (Vector).
|
||||
- \f[V]color\f[R]: Arc fill color (Color).
|
||||
- \f[V]end_angle\f[R]: Ending angle in degrees (float).
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -505,16 +513,14 @@ Applied to both horizontal and vertical edges unless overridden.
|
|||
Invalid for CENTER alignment (raises ValueError).
|
||||
- \f[V]name\f[R]: Name for finding this element (str).
|
||||
- \f[V]on_click\f[R]: Callable executed when arc is clicked.
|
||||
Function receives (pos: Vector, button: str, action: str).
|
||||
Function receives (pos: Vector, button: MouseButton, action:
|
||||
InputState).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
@ -701,14 +707,17 @@ Remove all children, keeping only the root node with original bounds.
|
|||
WARNING: Invalidates all existing BSPNode references from this tree.
|
||||
.PP
|
||||
\f[B]Returns:\f[R] BSP: self, for method chaining
|
||||
.SS \f[V]find(pos: tuple[int, int]) -> BSPNode | None\f[R]
|
||||
.SS \f[V]find(pos: tuple[int, int] | list | Vector) -> BSPNode | None\f[R]
|
||||
.PP
|
||||
Find the smallest (deepest) node containing the position.
|
||||
.PP
|
||||
Note:
|
||||
.PP
|
||||
\f[B]Arguments:\f[R] - \f[V]pos\f[R]: Position as (x, y) tuple, list, or
|
||||
Vector
|
||||
.PP
|
||||
\f[B]Returns:\f[R] BSPNode if found, None if position is outside bounds
|
||||
Also accepts two separate int arguments: find(x, y)
|
||||
.SS \f[V]get_leaf(index: int) -> BSPNode\f[R]
|
||||
.PP
|
||||
Get a leaf node by its index (0 to len(bsp)-1).
|
||||
|
|
@ -739,7 +748,7 @@ horizontal=False creates a vertical divider, producing left/right rooms.
|
|||
Split coordinate (y for horizontal, x for vertical)
|
||||
.PP
|
||||
\f[B]Returns:\f[R] BSP: self, for method chaining
|
||||
.SS \f[V]split_recursive(depth: int, min_size: tuple[int, int], max_ratio: float = 1.5, seed: int = None) -> BSP\f[R]
|
||||
.SS \f[V]split_recursive(depth: int, min_size: tuple[int, int], max_ratio: float = 1.5, seed: int | None = None) -> BSP\f[R]
|
||||
.PP
|
||||
Recursively split to the specified depth.
|
||||
WARNING: Invalidates all existing BSPNode references from this tree.
|
||||
|
|
@ -754,7 +763,7 @@ Default: 1.5.
|
|||
None for random.
|
||||
.PP
|
||||
\f[B]Returns:\f[R] BSP: self, for method chaining
|
||||
.SS \f[V]to_heightmap(size: tuple[int, int] = None, select: str = \[aq]leaves\[aq], shrink: int = 0, value: float = 1.0) -> HeightMap\f[R]
|
||||
.SS \f[V]to_heightmap(size: tuple[int, int] | None = None, select: str = \[aq]leaves\[aq], shrink: int = 0, value: float = 1.0) -> HeightMap\f[R]
|
||||
.PP
|
||||
Convert BSP node selection to a HeightMap.
|
||||
.PP
|
||||
|
|
@ -967,16 +976,17 @@ bounds (Alignment enum or None).
|
|||
When set, position is automatically calculated when parent is assigned
|
||||
or resized.
|
||||
Set to None to disable alignment and use manual positioning.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]fill_color\f[R]: Fill color of the text (Color).
|
||||
Returns a copy; modifying components requires reassignment.
|
||||
For animation, use `fill_color.r', `fill_color.g', etc.
|
||||
- \f[V]font_size\f[R]: Font size in points (int).
|
||||
Clamped to the range [0, 65535].
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -998,16 +1008,14 @@ Applied to both horizontal and vertical edges unless overridden.
|
|||
Invalid for CENTER alignment (raises ValueError).
|
||||
- \f[V]name\f[R]: Name for finding elements (str).
|
||||
- \f[V]on_click\f[R]: Callable executed when object is clicked.
|
||||
Function receives (pos: Vector, button: str, action: str).
|
||||
Function receives (pos: Vector, button: MouseButton, action:
|
||||
InputState).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
@ -1144,13 +1152,14 @@ bounds (Alignment enum or None).
|
|||
When set, position is automatically calculated when parent is assigned
|
||||
or resized.
|
||||
Set to None to disable alignment and use manual positioning.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]center\f[R]: Center position of the circle (Vector).
|
||||
- \f[V]fill_color\f[R]: Fill color of the circle (Color).
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -1171,16 +1180,14 @@ Invalid for CENTER alignment (raises ValueError).
|
|||
- \f[V]name\f[R]: Name for finding this element (str).
|
||||
- \f[V]on_click\f[R]: Callable executed when circle is clicked (Callable
|
||||
| None).
|
||||
Function receives (pos: Vector, button: str, action: str).
|
||||
Function receives (pos: Vector, button: MouseButton, action:
|
||||
InputState).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
@ -1401,7 +1408,7 @@ layer dimensions) - \f[V]range\f[R]: Value range as (min, max) inclusive
|
|||
Color at range maximum
|
||||
.PP
|
||||
\f[B]Returns:\f[R] self for method chaining
|
||||
.SS \f[V]apply_perspective(entity: Entity, visible: Color = None, discovered: Color = None, unknown: Color = None) -> None\f[R]
|
||||
.SS \f[V]apply_perspective(entity: Entity, visible: Color | None = None, discovered: Color | None = None, unknown: Color | None = None) -> None\f[R]
|
||||
.PP
|
||||
Bind this layer to an entity for automatic FOV updates.
|
||||
After binding, call update_perspective() when the entity moves.
|
||||
|
|
@ -1434,7 +1441,7 @@ layer dimensions) - \f[V]range\f[R]: Value range as (min, max) inclusive
|
|||
range
|
||||
.PP
|
||||
\f[B]Returns:\f[R] self for method chaining
|
||||
.SS \f[V]at(pos) or (x: int, y: int) -> Color\f[R]
|
||||
.SS \f[V]at(pos: tuple | Vector) or (x: int, y: int) -> Color\f[R]
|
||||
.PP
|
||||
Get the color at a cell position.
|
||||
.PP
|
||||
|
|
@ -1447,7 +1454,7 @@ Vector; or pass x and y separately
|
|||
.SS \f[V]clear_perspective() -> None\f[R]
|
||||
.PP
|
||||
Remove the perspective binding from this layer.
|
||||
.SS \f[V]draw_fov(source: tuple, radius: int = None, fov: FOV = None, visible: Color = None, discovered: Color = None, unknown: Color = None) -> None\f[R]
|
||||
.SS \f[V]draw_fov(source: tuple, radius: int | None = None, fov: FOV | None = None, visible: Color | None = None, discovered: Color | None = None, unknown: Color | None = None) -> None\f[R]
|
||||
.PP
|
||||
Paint cells based on field-of-view visibility from a source position.
|
||||
.PP
|
||||
|
|
@ -1813,7 +1820,8 @@ Base class for all drawable UI elements
|
|||
.PP
|
||||
\f[B]Properties:\f[R] - \f[V]on_click\f[R]: Callable executed when
|
||||
object is clicked.
|
||||
Function receives (pos: Vector, button: str, action: str).
|
||||
Function receives (pos: Vector, button: MouseButton, action:
|
||||
InputState).
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
Automatically clamped to valid range [0.0, 1.0].
|
||||
- \f[V]visible\f[R]: Whether the object is visible (bool).
|
||||
|
|
@ -2058,23 +2066,25 @@ Note:
|
|||
.PP
|
||||
\f[B]Arguments:\f[R] - \f[V]property\f[R]: Name of the property to
|
||||
animate: `draw_x', `draw_y' (tile coords), `sprite_scale',
|
||||
`sprite_index' - \f[V]target\f[R]: Target value - float, int, or list of
|
||||
int (for sprite frame sequences) - \f[V]duration\f[R]: Animation
|
||||
duration in seconds - \f[V]easing\f[R]: Easing function: Easing enum
|
||||
value, string name, or None for linear - \f[V]delta\f[R]: If True,
|
||||
target is relative to current value; if False, target is absolute -
|
||||
\f[V]loop\f[R]: If True, animation repeats from start when it reaches
|
||||
the end (default False) - \f[V]callback\f[R]: Optional callable invoked
|
||||
when animation completes (not called for looping animations) -
|
||||
\f[V]conflict_mode\f[R]: `replace' (default), `queue', or `error' if
|
||||
property already animating
|
||||
`sprite_index', `sprite_offset_x', `sprite_offset_y' - \f[V]target\f[R]:
|
||||
Target value - float, int, or list of int (for sprite frame sequences) -
|
||||
\f[V]duration\f[R]: Animation duration in seconds - \f[V]easing\f[R]:
|
||||
Easing function: Easing enum value, string name, or None for linear -
|
||||
\f[V]delta\f[R]: If True, target is relative to current value; if False,
|
||||
target is absolute - \f[V]loop\f[R]: If True, animation repeats from
|
||||
start when it reaches the end (default False) - \f[V]callback\f[R]:
|
||||
Optional callable invoked when animation completes (not called for
|
||||
looping animations) - \f[V]conflict_mode\f[R]: `replace' (default),
|
||||
`queue', or `error' if property already animating
|
||||
.PP
|
||||
\f[B]Returns:\f[R] Animation object for monitoring progress
|
||||
.PP
|
||||
\f[B]Raises:\f[R] ValueError: If property name is not valid for Entity
|
||||
(draw_x, draw_y, sprite_scale, sprite_index) Use `draw_x'/`draw_y' to
|
||||
animate tile coordinates for smooth movement between grid cells.
|
||||
(draw_x, draw_y, sprite_scale, sprite_index, sprite_offset_x,
|
||||
sprite_offset_y) Use `draw_x'/`draw_y' to animate tile coordinates for
|
||||
smooth movement between grid cells.
|
||||
Use list target with loop=True for repeating sprite frame animations.
|
||||
`x' and `y' are accepted as aliases for `draw_x' and `draw_y'.
|
||||
.SS \f[V]at(x: int, y: int) -> GridPoint | None\f[R]
|
||||
.PP
|
||||
Return the GridPoint at (x, y) if currently VISIBLE to this entity\[cq]s
|
||||
|
|
@ -2184,18 +2194,22 @@ Note:
|
|||
.PP
|
||||
\f[B]Returns:\f[R] None Called automatically when the entity moves if
|
||||
the grid has FOV configured.
|
||||
.SS \f[V]visible_entities(fov=None, radius: int = None) -> list[Entity]\f[R]
|
||||
.SS \f[V]visible_entities(fov=None, radius: int = -1) -> list[Entity]\f[R]
|
||||
.PP
|
||||
Get list of other entities visible from this entity\[cq]s position.
|
||||
.PP
|
||||
Note:
|
||||
.PP
|
||||
\f[B]Arguments:\f[R] - \f[V]fov\f[R]: FOV algorithm to use (FOV enum or
|
||||
None to use grid.fov) - \f[V]radius\f[R]: FOV radius (int or None to use
|
||||
grid.fov_radius)
|
||||
None to use grid.fov) - \f[V]radius\f[R]: FOV radius as int; omit or
|
||||
pass -1 to use the grid\[cq]s default fov_radius
|
||||
.PP
|
||||
\f[B]Returns:\f[R] List of Entity objects within field of view,
|
||||
excluding self
|
||||
.PP
|
||||
\f[B]Raises:\f[R] ValueError: If entity is not associated with a grid
|
||||
radius does not accept None; omit the argument entirely to use the grid
|
||||
default.
|
||||
.SS Entity3D
|
||||
.PP
|
||||
Entity3D(pos=None, **kwargs)
|
||||
|
|
@ -2469,8 +2483,9 @@ bounds (Alignment enum or None).
|
|||
When set, position is automatically calculated when parent is assigned
|
||||
or resized.
|
||||
Set to None to disable alignment and use manual positioning.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]cache_subtree\f[R]: Cache the frame and all children to a render
|
||||
texture for performance (bool).
|
||||
Useful for complex static subtrees.
|
||||
|
|
@ -2483,9 +2498,9 @@ Enables render-texture mode when True.
|
|||
- \f[V]fill_color\f[R]: Fill color of the rectangle (Color).
|
||||
Returns a copy; modifying components requires reassignment.
|
||||
For animation, use `fill_color.r', `fill_color.g', etc.
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -2506,16 +2521,14 @@ Applied to both horizontal and vertical edges unless overridden.
|
|||
Invalid for CENTER alignment (raises ValueError).
|
||||
- \f[V]name\f[R]: Name for finding elements (str).
|
||||
- \f[V]on_click\f[R]: Callable executed when object is clicked.
|
||||
Function receives (pos: Vector, button: str, action: str).
|
||||
Function receives (pos: Vector, button: MouseButton, action:
|
||||
InputState).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
@ -2643,18 +2656,19 @@ bounds (Alignment enum or None).
|
|||
When set, position is automatically calculated when parent is assigned
|
||||
or resized.
|
||||
Set to None to disable alignment and use manual positioning.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]camera_rotation\f[R]: Rotation of grid contents around camera
|
||||
center in degrees (float).
|
||||
- \f[V]center\f[R]: Camera center point in pixel coordinates (tuple).
|
||||
- \f[V]center\f[R]: Camera center point in pixel coordinates (Vector).
|
||||
- \f[V]center_x\f[R]: Camera center X-coordinate in pixel space (float).
|
||||
- \f[V]center_y\f[R]: Camera center Y-coordinate in pixel space (float).
|
||||
- \f[V]fill_color\f[R]: Background fill color (Color).
|
||||
Drawn behind all tiles and entities.
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -2675,14 +2689,11 @@ Invalid for CENTER alignment (raises ValueError).
|
|||
- \f[V]on_click\f[R]: Callable executed when object is clicked (Callable
|
||||
| None).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
@ -2706,7 +2717,8 @@ Animatable property.
|
|||
When set, the drawable is rendered through the shader program.
|
||||
Set to None to disable shader effects.
|
||||
- \f[V]texture\f[R] \f[I](read-only)\f[R]: Texture used for tile
|
||||
rendering (Texture | None, read-only).
|
||||
rendering (None, read-only).
|
||||
Texture return is not yet implemented; always returns None.
|
||||
- \f[V]uniforms\f[R] \f[I](read-only)\f[R]: Collection of shader
|
||||
uniforms (read-only access to collection).
|
||||
Set uniforms via dict-like syntax: drawable.uniforms[`name'] = value.
|
||||
|
|
@ -2809,18 +2821,19 @@ bounds (Alignment enum or None).
|
|||
When set, position is automatically calculated when parent is assigned
|
||||
or resized.
|
||||
Set to None to disable alignment and use manual positioning.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]camera_rotation\f[R]: Rotation of grid contents around camera
|
||||
center in degrees (float).
|
||||
- \f[V]center\f[R]: Camera center point in pixel coordinates (tuple).
|
||||
- \f[V]center\f[R]: Camera center point in pixel coordinates (Vector).
|
||||
- \f[V]center_x\f[R]: Camera center X-coordinate in pixel space (float).
|
||||
- \f[V]center_y\f[R]: Camera center Y-coordinate in pixel space (float).
|
||||
- \f[V]fill_color\f[R]: Background fill color (Color).
|
||||
Drawn behind all tiles and entities.
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -2841,14 +2854,11 @@ Invalid for CENTER alignment (raises ValueError).
|
|||
- \f[V]on_click\f[R]: Callable executed when object is clicked (Callable
|
||||
| None).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
@ -2872,7 +2882,8 @@ Animatable property.
|
|||
When set, the drawable is rendered through the shader program.
|
||||
Set to None to disable shader effects.
|
||||
- \f[V]texture\f[R] \f[I](read-only)\f[R]: Texture used for tile
|
||||
rendering (Texture | None, read-only).
|
||||
rendering (None, read-only).
|
||||
Texture return is not yet implemented; always returns None.
|
||||
- \f[V]uniforms\f[R] \f[I](read-only)\f[R]: Collection of shader
|
||||
uniforms (read-only access to collection).
|
||||
Set uniforms via dict-like syntax: drawable.uniforms[`name'] = value.
|
||||
|
|
@ -3666,13 +3677,14 @@ bounds (Alignment enum or None).
|
|||
When set, position is automatically calculated when parent is assigned
|
||||
or resized.
|
||||
Set to None to disable alignment and use manual positioning.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]color\f[R]: Line color as a Color object.
|
||||
- \f[V]end\f[R]: Ending point of the line as a Vector.
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -3692,16 +3704,14 @@ Applied to both horizontal and vertical edges unless overridden.
|
|||
Invalid for CENTER alignment (raises ValueError).
|
||||
- \f[V]name\f[R]: Name for finding this element.
|
||||
- \f[V]on_click\f[R]: Callable executed when line is clicked.
|
||||
Function receives (pos: Vector, button: str, action: str).
|
||||
Function receives (pos: Vector, button: MouseButton, action:
|
||||
InputState).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
@ -4527,11 +4537,12 @@ bounds (Alignment enum or None).
|
|||
When set, position is automatically calculated when parent is assigned
|
||||
or resized.
|
||||
Set to None to disable alignment and use manual positioning.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -4551,16 +4562,14 @@ Applied to both horizontal and vertical edges unless overridden.
|
|||
Invalid for CENTER alignment (raises ValueError).
|
||||
- \f[V]name\f[R]: Name for finding elements (str).
|
||||
- \f[V]on_click\f[R]: Callable executed when object is clicked.
|
||||
Function receives (pos: Vector, button: str, action: str).
|
||||
Function receives (pos: Vector, button: MouseButton, action:
|
||||
InputState).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
@ -4837,7 +4846,7 @@ layer dimensions) - \f[V]range\f[R]: Value range as (min, max) inclusive
|
|||
- \f[V]tile\f[R]: Tile index to set for cells in range
|
||||
.PP
|
||||
\f[B]Returns:\f[R] self for method chaining
|
||||
.SS \f[V]at(pos) or (x: int, y: int) -> int\f[R]
|
||||
.SS \f[V]at(pos: tuple | Vector) or (x: int, y: int) -> int\f[R]
|
||||
.PP
|
||||
Get the tile index at a cell position.
|
||||
Returns -1 if no tile is set.
|
||||
|
|
@ -5459,8 +5468,9 @@ Default: 10 fog_far (float): Fog end distance.
|
|||
Default: 100
|
||||
.PP
|
||||
\f[B]Properties:\f[R] - \f[V]bg_color\f[R]: Background clear color.
|
||||
- \f[V]bounds\f[R]: Bounding box as (pos, size) tuple of Vectors.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding box
|
||||
(tuple, read-only) as a (pos, size) pair of Vectors: (Vector(x, y),
|
||||
Vector(width, height)).
|
||||
- \f[V]camera_pos\f[R]: Camera position as (x, y, z) tuple.
|
||||
- \f[V]camera_target\f[R]: Camera look-at target as (x, y, z) tuple.
|
||||
- \f[V]cell_size\f[R]: World units per navigation grid cell.
|
||||
|
|
@ -5477,9 +5487,9 @@ Use append/remove to modify.
|
|||
- \f[V]fog_far\f[R]: Fog end distance.
|
||||
- \f[V]fog_near\f[R]: Fog start distance.
|
||||
- \f[V]fov\f[R]: Camera field of view in degrees.
|
||||
- \f[V]global_bounds\f[R]: Bounding box as (pos, size) tuple of Vectors
|
||||
in screen coordinates.
|
||||
Returns (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_bounds\f[R] \f[I](read-only)\f[R]: Axis-aligned bounding
|
||||
box in screen coordinates (tuple, read-only) as a (pos, size) pair of
|
||||
Vectors: (Vector(x, y), Vector(width, height)).
|
||||
- \f[V]global_position\f[R] \f[I](read-only)\f[R]: Global screen
|
||||
position (read-only).
|
||||
Calculates absolute position by walking up the parent chain.
|
||||
|
|
@ -5490,16 +5500,14 @@ tuple.
|
|||
over this element (read-only).
|
||||
Updated automatically by the engine during mouse movement.
|
||||
- \f[V]on_click\f[R]: Callable executed when object is clicked.
|
||||
Function receives (pos: Vector, button: str, action: str).
|
||||
Function receives (pos: Vector, button: MouseButton, action:
|
||||
InputState).
|
||||
- \f[V]on_enter\f[R]: Callback for mouse enter events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse enters
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse enters this element\[cq]s bounds.
|
||||
- \f[V]on_exit\f[R]: Callback for mouse exit events.
|
||||
Called with (pos: Vector, button: str, action: str) when mouse leaves
|
||||
this element\[cq]s bounds.
|
||||
Called with (pos: Vector) when mouse leaves this element\[cq]s bounds.
|
||||
- \f[V]on_move\f[R]: Callback for mouse movement within bounds.
|
||||
Called with (pos: Vector, button: str, action: str) for each mouse
|
||||
movement while inside.
|
||||
Called with (pos: Vector) for each mouse movement while inside.
|
||||
Performance note: Called frequently during movement - keep handlers
|
||||
fast.
|
||||
- \f[V]opacity\f[R]: Opacity level (0.0 = transparent, 1.0 = opaque).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue