Crate thomas

Source

Structs§

Coords2d
Coords3d
Dimensions2d
EngineAnalysisOptions
EngineAnalysisSystemsGenerator
Generator responsible for setting up and performing engine performance analysis. To use the data generated by the analysis, you can query for the EngineStats component.
EngineStats
Represents stats tracked by the engine to report on its performance.
Entity
An Entity represents a thing in your game world and is one of the core aspects of ECS. Functionally, you can think of an Entity as its ID. Entities are associated with Components to define what data that Entity has. Though it’s likely you’ll use Entity references provided to you, you should never be creating an Entity yourself.
Game
The core structure of any game made with Thomas. The Game instance facilitates communication with Thomas’ internal mechanisms to automate the nitty gritty details of running the game.
GameCommandQueue
GameOptions
Identity
Identifying information that can be used to give entities meaningful identifying factors.
Input
Represents received user input.
IntCoords2d
IntCoords3d
Layer
Useful in several contexts, Layers are a way to represent how something exists relative to other things.
Matrix
A 2D matrix with defined iteration order.
MatrixCell
MatrixIter
Priority
A representation of how important something is relative to something else.
Query
Represents how to pull specific entities and components out of the world for use by a System. Methods in a Query can be chained to create more complex queries. All chains are treated like logical ANDs.
QueryResult
Represents a single match from a query.
QueryResultList
A collection of matches against a query. Queries will typically match on more than one entity in the world, so this is the representation you’ll see when interacting with the results of a query.
Rgb
Represents an RGB color.
StoredComponentList
A list of components that are currently stored in the game world.
System
A System represents a function that uses the result of a collection of queries to act on and potentially mutate the game world. Systems are a core aspect of ECS. Systems are where the bulk of the logic of your game will live, as they’re responsible for changing game state based on existing state.
TerminalCamera
TerminalCollider
Marks that an entity in the world is capable of colliding with other TerminalColliders.
TerminalCollision
Represents a collision between two TerminalColliders. Also provides the entities that collided.
TerminalCollisionsSystemsGenerator
A generator responsible for setting up and performing collision detection between active TerminalColliders in the world. This systems generator is included for you, you don’t need to include it.
TerminalRenderer
Data to describe how to render something in the terminal.
TerminalRendererOptions
TerminalRendererState
TerminalTransform
Positional data for a world in the terminal where it’s 2D and strictly gridded.
TerminalUiRendererSystemsGenerator
A generator responsible for setting up and performing UI rendering in a terminal game. This systems generator is included for you, you don’t need to include it.
Text
Text UI data that describes how the Text should be visible on the screen.
Time
Timer
A way to track the passage of real time.
Transform
Positional data for a 3D world.
Transform2d
Positional data for a 2D world.
WorldText
Text UI that’s rendered in the world space rather than a camera’s screen space.

Enums§

Alignment
GameCommand
Keycode
A list of supported keys that we can query from the OS. Outside of mod.
Renderer
UiAnchor
Where the UI element is anchored on the screen. The anchor represents where the element is positioned by default when it has no offset.

Constants§

EVENT_AFTER_INIT
The after-init event. Runs once after the init event.
EVENT_AFTER_UPDATE
The after-update event. Runs once per frame after the update event.
EVENT_BEFORE_UPDATE
The before-update event. Runs once per frame before the update event.
EVENT_CLEANUP
The cleanup event. Runs once after the main game loop ends.
EVENT_INIT
The init event. Runs once before the main game loop starts.
EVENT_UPDATE
The update event. Runs once per frame.
FPS_TRACKER_ID

Traits§

Component
A Component is essentially a data bucket and is one of the core aspects of ECS. A Component houses no logic and is simply meant to be a repository for related data. In Thomas, you should never be implementing the Component trait directly, but rather deriving it to create your own custom components:
Lerp
SystemsGenerator
A simple way to organize related systems into a unit. You can easily add all systems created by a SystemsGenerator to your game using the Game::add_systems_from_generator method.

Type Aliases§

GameCommandsArg
IntVector2
IntVector3
OperatorFn
The function that’s given to a System to run against its queries’ matches.
StoredComponent
TerminalCollisionBody
Vector2
Vector3
WherePredicate

Derive Macros§

Component