zenilib: Zeni::Widget_Gamestate Class Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
Zeni::Widget_Gamestate Class Reference
Zenilib

Gamestate with some helpers for dealing with Widgets. More...

`#include <Widget_Gamestate.h>`

Inherits Zeni::Gamestate_Base.

Inherited by Instructions_State, Zeni::Configurator_Video, Zeni::Configurator_Video::Check_State, Zeni::Popup_State, and Zeni::Title_State< PLAY_STATE, INSTRUCTIONS_STATE >.

## Public Member Functions

| Widget_Gamestate (const std::pair< Point2f, Point2f > &virtual_window_, const bool &fix_aspect_ratio_=true)
const bool & | fix_aspect_ratio () const
const std::pair< Point2f, Point2f > & | get_virtual_window () const
void | on_key (const SDL_KeyboardEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
void | on_mouse_button (const SDL_MouseButtonEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
void | on_mouse_motion (const SDL_MouseMotionEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
void | on_pop ()
| Called when the Gamestate is popped off the stack in Game. More...
void | on_push ()
| Called when the Gamestate is pushed onto the stack in Game. More...
void | perform_logic ()
| Then perform logic. Called by Game as part of the main gameloop. More...
void | render ()
| Then render. Called by Game as part of the main gameloop. More...
Public Member Functions inherited from Zeni::Gamestate_Base
| Gamestate_Base ()
virtual | ~Gamestate_Base ()
const bool & | is_pausable () const
virtual void | on_cover ()
| Called when a Gamestate is pushed on top of this Gamestate in Game. More...
virtual void | on_event (const SDL_Event &event)
| First check for events. Called by Game as part of the main gameloop. More...
virtual void | on_uncover ()
| Called when a Gamestate is popped off Game, making this Gamestate on top. More...
virtual void | prerender ()
| No actual rendering, but any logic strictly necessary for rendering. More...
void | set_pausable (const bool &pausable_)

## Protected Attributes

Widgets | m_widgets

## Additional Inherited Members

Static Public Member Functions inherited from Zeni::Gamestate_Base
static char | to_char (const SDL_Keysym &ks)
| Returns a character key corresponding to the current combination of keys pressed or the null character (0). More...
static SDL_Keycode | to_sym (const String &text_version)
| Convert a text representation to an actual sym. More...
static String | to_text (const SDL_Keycode &sym)
| Convert a sym to a text representation. More...
Protected Member Functions inherited from Zeni::Gamestate_Base
virtual void | on_active (const SDL_ActiveEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
virtual void | on_controller_axis (const SDL_ControllerAxisEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
virtual void | on_controller_button (const SDL_ControllerButtonEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
virtual void | on_controller_device (const SDL_ControllerDeviceEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
virtual void | on_quit (const SDL_QuitEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
virtual void | on_system_wm_event (const SDL_SysWMEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
virtual void | on_user_event (const SDL_UserEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
virtual void | on_video_expose (const SDL_ExposeEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...
virtual void | on_video_resize (const SDL_ResizeEvent &event)
| Override this input callback in your Gamestates. See SDL documentation for details. More...

## Detailed Description

Gamestate with some helpers for dealing with Widgets.

Author
  bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 38 of file Widget_Gamestate.h.

## Constructor & Destructor Documentation

Zeni::Widget_Gamestate::Widget_Gamestate | ( | const std::pair< Point2f, Point2f > & | virtual_window_,
|  | const bool & | fix_aspect_ratio_ = `true`
| ) |  |

Definition at line 22 of file Widget_Gamestate.cpp.

## Member Function Documentation

const bool & Zeni::Widget_Gamestate::fix_aspect_ratio | ( |  | ) | const

Definition at line 32 of file Widget_Gamestate.cpp.

const std::pair< Point2f, Point2f > & Zeni::Widget_Gamestate::get_virtual_window | ( |  | ) | const

Definition at line 28 of file Widget_Gamestate.cpp.

void Zeni::Widget_Gamestate::on_key | ( | const SDL_KeyboardEvent & | event | ) |

virtual

Override this input callback in your Gamestates. See SDL documentation for details.

Reimplemented from Zeni::Gamestate_Base.

Definition at line 55 of file Widget_Gamestate.cpp.

References Zeni::Widget::is_busy(), m_widgets, Zeni::Widget::on_event(), and Zeni::Gamestate_Base::on_key().

void Zeni::Widget_Gamestate::on_mouse_button | ( | const SDL_MouseButtonEvent & | event | ) |

virtual

Override this input callback in your Gamestates. See SDL documentation for details.

Reimplemented from Zeni::Gamestate_Base.

Definition at line 61 of file Widget_Gamestate.cpp.

References m_widgets, and Zeni::Widget::on_event().

void Zeni::Widget_Gamestate::on_mouse_motion | ( | const SDL_MouseMotionEvent & | event | ) |

virtual

Override this input callback in your Gamestates. See SDL documentation for details.

Reimplemented from Zeni::Gamestate_Base.

Definition at line 65 of file Widget_Gamestate.cpp.

References m_widgets, and Zeni::Widget::on_event().

void Zeni::Widget_Gamestate::on_pop | ( |  | ) |

virtual

Called when the Gamestate is popped off the stack in Game.

Reimplemented from Zeni::Gamestate_Base.

Definition at line 48 of file Widget_Gamestate.cpp.

References Zeni::Game::controller_mouse, Zeni::Game::Controller_Mouse::enabled, Zeni::get_Game(), Zeni::get_Video(), Zeni::get_Window(), Zeni::Video::set_clear_Color(), and Zeni::Window::set_mouse_state().

Referenced by Zeni::Popup_State::on_pop().

void Zeni::Widget_Gamestate::on_push | ( |  | ) |

virtual

Called when the Gamestate is pushed onto the stack in Game.

Reimplemented from Zeni::Gamestate_Base.

Definition at line 36 of file Widget_Gamestate.cpp.

References Zeni::Game::controller_mouse, Zeni::Game::Controller_Mouse::enabled, Zeni::Video::get_clear_Color(), Zeni::get_Game(), Zeni::Window::get_mouse_state(), Zeni::get_Video(), Zeni::get_Window(), Zeni::Window::MOUSE_NORMAL, and Zeni::Window::set_mouse_state().

Referenced by Zeni::Popup_State::on_push().

void Zeni::Widget_Gamestate::perform_logic | ( |  | ) |

virtual

Then perform logic. Called by Game as part of the main gameloop.

Reimplemented from Zeni::Gamestate_Base.

Definition at line 76 of file Widget_Gamestate.cpp.

References Zeni::Video::calculate_viewport(), Zeni::get_Video(), Zeni::get_Window(), m_widgets, and Zeni::Widgets::perform_logic().

Referenced by Zeni::Popup_State::perform_logic(), and Zeni::Title_State< PLAY_STATE, INSTRUCTIONS_STATE >::perform_logic().

void Zeni::Widget_Gamestate::render | ( |  | ) |

virtual

Then render. Called by Game as part of the main gameloop.

Reimplemented from Zeni::Gamestate_Base.

Definition at line 83 of file Widget_Gamestate.cpp.

References Zeni::get_Video(), m_widgets, Zeni::Widget::render(), and Zeni::Video::set_2d().

## Member Data Documentation

Widgets Zeni::Widget_Gamestate::m_widgets

protected

Definition at line 63 of file Widget_Gamestate.h.

Referenced by Zeni::Configurator_Video::Check_State::Check_State(), Zeni::Configurator_Video::Configurator_Video(), on_key(), on_mouse_button(), on_mouse_motion(), perform_logic(), render(), and Zeni::Title_State< PLAY_STATE, INSTRUCTIONS_STATE >::Title_State().

The documentation for this class was generated from the following files:

- zenilib/jni/external/zenilib/zeni_rest/Zeni/Widget_Gamestate.h
- zenilib/jni/external/zenilib/zeni_rest/Widget_Gamestate.cpp