Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Functions
draw.cpp File Reference
#include "draw.h"
#include "board_layout.h"
#include "game_options.h"
#include "square_layout.h"
#include "game_resources.h"
#include "physical_controllers.h"
#include "piece.h"
#include "render_window.h"
#include "sfml_helper.h"
#include "navigation_controls_layout.h"
#include <SFML/Graphics/RectangleShape.hpp>
#include <cassert>
#include <sstream>
Include dependency graph for draw.cpp:

Functions

void draw_about_button (const screen_rect &sr)
 Draw an About menu button on the main window.
 
void draw_big_text (const sf::String &s, const screen_rect &sr)
 Draw the text on the main window.
 
void draw_chessboard_strip_texture (const chess_color c, const screen_rect &sr)
 Draw a chessboard strip texture.
 
void draw_controls_label (const screen_rect &sr)
 A fancy label that shows the text 'Controls'.
 
void draw_fancy_physical_controller_label (const physical_controller_type &t, const screen_rect &sr)
 Draw the fancy physical controller texture with a text on it.
 
void draw_fancy_physical_controller_type (const physical_controller_type &t, const screen_rect &sr)
 Draw the fancy physical controller texture.
 
void draw_fancy_text (const sf::String &s, const screen_rect &sr, const int outer_character_size, const int inner_character_size)
 Draw fancy text at any custom size.
 
void draw_game_speed_icon (const screen_rect &sr)
 The button that shows the text 'Game Speed'.
 
void draw_game_speed_value (const screen_rect &sr, const game_speed speed)
 The button that shows the value for the game speed.
 
void draw_huge_fancy_text (const sf::String &s, const screen_rect &sr)
 Draw fancy text at a huge size.
 
void draw_input_prompt_inverted_symbol (const sf::Keyboard::Key &k, const screen_rect &r)
 Draw the inverted symbol for a keyboard input prompt.
 
void draw_input_prompt_symbol (const sf::Keyboard::Key &k, const screen_rect &r)
 Draw a symbol for a keyboard input prompt.
 
void draw_input_prompt_symbol (const sf::Mouse::Button &k, const screen_rect &r)
 Draw a symbol for a mouse input prompt.
 
void draw_input_prompt_inverted_symbol_on_background (const sf::Keyboard::Key &k, const screen_rect &r, const sf::Color background_color)
 Draw a symbol for a keyboard input prompt on a background.
 
void draw_input_prompt_symbol_on_background (const sf::Keyboard::Key &k, const screen_rect &r, const sf::Color background_color)
 Draw a symbol for a keyboard input prompt on a background.
 
void draw_music_volume_label (const screen_rect &sr)
 The button that shows the text 'Music volume'.
 
void draw_music_volume_value (const screen_rect &sr, const volume v)
 The button that shows the value of the music.
 
void draw_navigation_controls (const physical_controllers &pc, const navigation_controls_layout &layout, const side p)
 Draw the navigation controls for a player.
 
void draw_normal_text (const sf::String &s, const screen_rect &sr)
 Draw the text on the main window.
 
void draw_normal_fancy_text (const sf::String &s, const screen_rect &sr)
 Draw fancy text at a normal size.
 
void draw_normal_texts (const std::vector< sf::String > &s, const screen_rect &r)
 Draw the texts on the main window, using one row per element.
 
void draw_options_button (const screen_rect &sr)
 Draw an Options menu button on the main window.
 
void draw_outline (const screen_rect &sr, const sf::Color &outline_color, const int outline_thickness)
 Draw a thick, red outline at the edges of this rectangle.
 
void draw_physical_controller_symbol (const physical_controller_type &t, const screen_rect &sr)
 Draw the fancy physical controller symbol.
 
void draw_quit_button (const screen_rect &sr)
 Draw a Quit menu button on the main window.
 
void draw_rectangle (const screen_rect &sr, const sf::Color &fill_color)
 Draw a rectangle.
 
void draw_sound_effects_volume_label (const screen_rect &sr)
 The button that shows the text 'Sound effects volume'.
 
void draw_sound_effects_volume_value (const screen_rect &sr, const volume v)
 The button that shows the value of the music.
 
void draw_start_button (const screen_rect &sr)
 Draw a Start menu button on the main window.
 
void draw_starting_position_label (const screen_rect &sr)
 A fancy label that shows the text 'Starting position'.
 
void draw_starting_position_value (const screen_rect &sr, const starting_position_type t)
 A fancy label that shows the value of the starting position.
 
void draw_text (const sf::String &s, const screen_rect &sr, const int character_size, const sf::Color fill_color)
 Draw the text on the main window.
 
void draw_texts (const std::vector< sf::String > &s, const screen_rect &r, const int character_size, const sf::Color fill_color)
 Draw the texts on the main window, using one row per element.
 
void draw_texture (sf::Texture &t, const screen_rect &sr, const sf::Color &fill_color)
 Draw the texture on the main window scaled to that size.
 
void draw_texture (sf::Texture &t, const screen_coordinate &c, const screen_coordinate &size)
 

Function Documentation

◆ draw_about_button()

void draw_about_button ( const screen_rect sr)

Draw an About menu button on the main window.

◆ draw_big_text()

void draw_big_text ( const sf::String &  s,
const screen_rect r 
)

Draw the text on the main window.

Use Ariel font, 48 pixels, black letters and bold face

◆ draw_chessboard_strip_texture()

void draw_chessboard_strip_texture ( const chess_color  c,
const screen_rect sr 
)

Draw a chessboard strip texture.

◆ draw_controls_label()

void draw_controls_label ( const screen_rect sr)

A fancy label that shows the text 'Controls'.

◆ draw_fancy_physical_controller_label()

void draw_fancy_physical_controller_label ( const physical_controller_type t,
const screen_rect sr 
)

Draw the fancy physical controller texture with a text on it.

◆ draw_fancy_physical_controller_type()

void draw_fancy_physical_controller_type ( const physical_controller_type t,
const screen_rect sr 
)

Draw the fancy physical controller texture.

◆ draw_fancy_text()

void draw_fancy_text ( const sf::String &  s,
const screen_rect sr,
const int  outer_character_size,
const int  inner_character_size 
)

Draw fancy text at any custom size.

◆ draw_game_speed_icon()

void draw_game_speed_icon ( const screen_rect sr)

The button that shows the text 'Game Speed'.

◆ draw_game_speed_value()

void draw_game_speed_value ( const screen_rect sr,
const game_speed  speed 
)

The button that shows the value for the game speed.

◆ draw_huge_fancy_text()

void draw_huge_fancy_text ( const sf::String &  s,
const screen_rect sr 
)

Draw fancy text at a huge size.

◆ draw_input_prompt_inverted_symbol()

void draw_input_prompt_inverted_symbol ( const sf::Keyboard::Key &  k,
const screen_rect r 
)

Draw the inverted symbol for a keyboard input prompt.

For example, a symbol for the key A

@seealso Use draw_input_prompt_symbol} for the regular symbol

◆ draw_input_prompt_inverted_symbol_on_background()

void draw_input_prompt_inverted_symbol_on_background ( const sf::Keyboard::Key &  k,
const screen_rect r,
const sf::Color  background_color = sf::Color::Black 
)

Draw a symbol for a keyboard input prompt on a background.

For example, a symbol for the key A on a black background

@seealso Use draw_input_prompt_symbol_on_background} for the regular symbol

◆ draw_input_prompt_symbol() [1/2]

void draw_input_prompt_symbol ( const sf::Keyboard::Key &  k,
const screen_rect r 
)

Draw a symbol for a keyboard input prompt.

For example, a symbol for the key A

@seealso

  • There is a function with an identical name for mouse buttons
  • Use draw_input_prompt_inverted_symbol} for the inverted symbol

◆ draw_input_prompt_symbol() [2/2]

void draw_input_prompt_symbol ( const sf::Mouse::Button &  k,
const screen_rect r 
)

Draw a symbol for a mouse input prompt.

For example, a symbol for the left mouse button

@seealso

  • There is a function with an identical name for keyboard buttons

◆ draw_input_prompt_symbol_on_background()

void draw_input_prompt_symbol_on_background ( const sf::Keyboard::Key &  k,
const screen_rect r,
const sf::Color  background_color = sf::Color::Black 
)

Draw a symbol for a keyboard input prompt on a background.

For example, a symbol for the key A on a black background

@seealso Use draw_input_prompt_inverted_symbol_on_background} for the inverted symbol

◆ draw_music_volume_label()

void draw_music_volume_label ( const screen_rect sr)

The button that shows the text 'Music volume'.

◆ draw_music_volume_value()

void draw_music_volume_value ( const screen_rect sr,
const volume  v 
)

The button that shows the value of the music.

◆ draw_navigation_controls()

void draw_navigation_controls ( const physical_controllers pc,
const navigation_controls_layout r,
const side  p 
)

Draw the navigation controls for a player.

Must be 3x64 pixels wide and 2x64 pixels high For a keyboard:

+---+
| W |
+---+---+---+
| A | S | D |
+---+---+---+

For a mouse

[Picture of a mouse with all four arrows]

◆ draw_normal_fancy_text()

void draw_normal_fancy_text ( const sf::String &  s,
const screen_rect sr 
)

Draw fancy text at a normal size.

◆ draw_normal_text()

void draw_normal_text ( const sf::String &  s,
const screen_rect r 
)

Draw the text on the main window.

Use Ariel font, 32 pixels, black letters and bold face

◆ draw_normal_texts()

void draw_normal_texts ( const std::vector< sf::String > &  s,
const screen_rect r 
)

Draw the texts on the main window, using one row per element.

Use Ariel font, 32 pixels, black letters and bold face

◆ draw_options_button()

void draw_options_button ( const screen_rect sr)

Draw an Options menu button on the main window.

◆ draw_outline()

void draw_outline ( const screen_rect sr,
const sf::Color &  outline_color,
const int  outline_thickness 
)

Draw a thick, red outline at the edges of this rectangle.

◆ draw_physical_controller_symbol()

void draw_physical_controller_symbol ( const physical_controller_type t,
const screen_rect sr 
)

Draw the fancy physical controller symbol.

◆ draw_quit_button()

void draw_quit_button ( const screen_rect sr)

Draw a Quit menu button on the main window.

◆ draw_rectangle()

void draw_rectangle ( const screen_rect sr,
const sf::Color &  fill_color 
)

Draw a rectangle.

◆ draw_sound_effects_volume_label()

void draw_sound_effects_volume_label ( const screen_rect sr)

The button that shows the text 'Sound effects volume'.

◆ draw_sound_effects_volume_value()

void draw_sound_effects_volume_value ( const screen_rect sr,
const volume  v 
)

The button that shows the value of the music.

◆ draw_start_button()

void draw_start_button ( const screen_rect sr)

Draw a Start menu button on the main window.

◆ draw_starting_position_label()

void draw_starting_position_label ( const screen_rect sr)

A fancy label that shows the text 'Starting position'.

◆ draw_starting_position_value()

void draw_starting_position_value ( const screen_rect sr,
const starting_position_type  t 
)

A fancy label that shows the value of the starting position.

◆ draw_text()

void draw_text ( const sf::String &  s,
const screen_rect r,
const int  character_size,
const sf::Color  fill_color = sf::Color::Black 
)

Draw the text on the main window.

Use Ariel font, black letters and bold face

◆ draw_texts()

void draw_texts ( const std::vector< sf::String > &  s,
const screen_rect r,
const int  character_size,
const sf::Color  fill_color 
)

Draw the texts on the main window, using one row per element.

◆ draw_texture() [1/2]

void draw_texture ( sf::Texture &  t,
const screen_coordinate c,
const screen_coordinate size 
)

◆ draw_texture() [2/2]

void draw_texture ( sf::Texture &  t,
const screen_rect sr,
const sf::Color &  fill_color 
)

Draw the texture on the main window scaled to that size.