Overview
Billboards are entities that display 2D sprites in 3D space. They include simple billboards, walls with directional textures, doors with animations, elevators for map transitions, and drops for item pickups.Function Reference
billboard_new()
Creates a basic billboard entity.Pointer to the game instance
Pointer to the window instance
Billboard identifier for configuration lookup
Pointer to the newly created billboard, or
NULL on allocation failurewall_new()
Creates a wall entity with directional textures.Pointer to the game instance
Pointer to the window instance
Wall identifier (use
'1' for default walls)Pointer to the newly created wall, or
NULL on allocation failuredoor_new_e()
Creates a door entity with opening/closing animations.Pointer to the game instance
Pointer to the window instance
Door identifier for configuration lookup
Pointer to the newly created door, or
NULL on error. Returns NULL if required configuration (direction, sprites) is missingelevator_new()
Creates an elevator entity for map transitions.Pointer to the game instance
Pointer to the window instance
Elevator identifier for configuration lookup
Pointer to the newly created elevator, or
NULL on allocation failuredrop_new()
Creates a drop entity for item pickups.Pointer to the game instance
Pointer to the window instance
Drop identifier for configuration lookup
Pointer to the newly created drop, or
NULL on allocation failureStructure Definitions
s_billboard
Basic billboard entity for displaying sprites in 3D space.Base entity structure
If true, sprite is vertically centered. If false, sprite is floor-aligned
360-degree sprite array for omnidirectional viewing
s_wall
Wall entity with directional textures.Base entity structure
Texture for north-facing wall surface
Texture for south-facing wall surface
Texture for west-facing wall surface
Texture for east-facing wall surface
s_door
Door entity with animation and auto-close functionality.Base wall structure
Door orientation (NORTH, SOUTH, EAST, WEST)
Animated sprite for opening/closing
Source sprite for animation frames
Sprite for door edges/sides
Current open/closed state
Prevents closing if true
Delay before automatic closing (0 = manual close only)
Timestamp when door was last opened
Current frame of animation
Whether door can be closed manually
Duration of animation in milliseconds
Number of animation frames (calculated from delay and FPS)
Sound played when door opens
Sound played when door closes
s_elevator
Elevator entity for transitioning between maps.Base wall structure
Path to the map file to load when activated
s_drop
Drop entity for item pickups in the game world.Base billboard entity
Pointer to the item contained in this drop
Previous item reference for state management
Whether the item is automatically used when picked up
Whether the item is automatically picked up when player is nearby
Constants
Default billboard collision width
Default billboard collision height
Maximum distance for wall interaction
Animation frames per second for door opening
Map Type Configuration
Billboard Configuration
Path to 360-degree sprite assets for idle state
"TRUE" for vertical centering, "FALSE" for floor alignment"TRUE" if entity can be targeted by weapons/AI"TRUE" to enable transparency renderingWall Configuration
North-facing wall texture
South-facing wall texture
West-facing wall texture
East-facing wall texture
'1' for standard walls, or custom identifiers for special walls.
Door Configuration
Door orientation:
"NORTH", "SOUTH", "EAST", or "WEST"Path to door texture sprite (used to generate animation frames)
Path to door edge/side texture
Seconds before automatic closing (0 = no auto-close)
"TRUE" to allow closing, "FALSE" to keep open (default: TRUE)Animation duration in seconds (multiplied by 10 internally)
Path to door open sound effect
Path to door close sound effect
Elevator Configuration
Path to the map file to load when elevator is activated
Door Animation System
Doors automatically generate animation frames based on configuration:- Animation Frames: Calculated as
animation_delay * DOOR_ANIMATION_FPS - Frame Generation: Door sprite is sliced into frames based on width
- Direction: North/South doors show opening sprite on north face, East/West doors show on west face
- Sides: Door edge sprites are applied to perpendicular faces
Example
See Also
- Characters - Character billboards
- Entities - Base entity system