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

A wrapper of Chess for GUI.

Implementations

Create a new instance of ChessGui.

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.

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

Called every time a key gets pressed.

Keys
KeysActions
EscapeQuit the game
RReset the game
CTRL+ZUndo

A mouse button was released

The mouse was moved; it provides both absolute x and y coordinates in the window, and relative x and y coordinates compared to its last position. Read more

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.