Struct chess::ChessGui

source ·
pub struct ChessGui { /* private fields */ }
Expand description

GUI for the Chess game.

Implementations

Create a new instance of ChessGui.

Reset The chess game and buttons but not the theme.

Set the theme for the GUI.

Examples
use chess::{ChessGui, THEME_SANDCASTLE};

let mut game = ChessGui::default();
game.set_theme(THEME_SANDCASTLE);

Set the theme to the next one for the GUI.

Safety

This function use/set a static variable.

Add a button in the GUI.

Base function to call when a user click on the screen.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Update will happen on every frame before it is drawn.

Render the game’s current state.

Called every time a mouse button gets pressed

Change the [ggez::input::mouse::CursorIcon] when the mouse is on a button.

Called every time a key gets pressed.

Keys
KeysActions
EscapeQuit the game
RReset the game and buttons
CTRL+ZUndo
A mouse button was released
mouse entered or left window area
The mousewheel was scrolled, vertically (y, positive away from and negative toward the user) or horizontally (x, positive to the right and negative to the left). Read more
A keyboard button was released.
A unicode character was received, usually from keyboard input. This is the intended way of facilitating text input. Read more
A gamepad button was pressed; id identifies which gamepad. Use input::gamepad() to get more info about the gamepad. Read more
A gamepad button was released; id identifies which gamepad. Use input::gamepad() to get more info about the gamepad. Read more
A gamepad axis moved; id identifies which gamepad. Use input::gamepad() to get more info about the gamepad. Read more
Called when the window is shown or hidden.
Called upon a quit event. If it returns true, the game does not exit (the quit event is cancelled). Read more
Called when the user resizes the window, or when it is resized via graphics::set_mode(). Read more
Something went wrong, causing a GameError. If this returns true, the error was fatal, so the event loop ends, aborting the game. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.