UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ugdk::action::Scene Class Reference

A game scene, or screen. More...

#include <ugdk/action/scene.h>

Inheritance diagram for ugdk::action::Scene:
Collaboration diagram for ugdk::action::Scene:

Public Member Functions

 Scene ()
 
virtual ~Scene ()
 
virtual void Focus ()
 Method called when this Scene arrives on the top of the Scene stack. More...
 
virtual void DeFocus ()
 Method called when this Scene leaves the top of the Scene stack. More...
 
virtual void OnPushed (int index)
 Method called when this scene is pushed to the Engine's Scene stack. More...
 
void Finish ()
 Finishes the scene. More...
 
void StopsPreviousMusic (bool set)
 Whether this scene stops the previous music even if wont play any music. More...
 
void Update (double delta_t)
 Logical update of the scene. More...
 
void Render (graphic::Canvas &) const
 Renders the scene to the given canvas if the scene is visible. More...
 
void set_render_function (const std::function< void(graphic::Canvas &canvas)> &render_function)
 
Getters and Setters
const std::string & identifier () const
 
void set_identifier (const std::string &new_identifier)
 
bool finished () const
 
bool active () const
 
void set_active (bool is_active)
 
bool visible () const
 
void set_visible (bool is_visible)
 
MediaManagermedia_manager ()
 
const MediaManagermedia_manager () const
 
system::EventHandlerevent_handler ()
 
const system::EventHandlerevent_handler () const
 
audio::Musicbackground_music () const
 
void set_background_music (audio::Music *music)
 
- Public Member Functions inherited from ugdk::system::TaskPlayer
 TaskPlayer ()
 
virtual ~TaskPlayer ()
 
void AddTask (const Task &task)
 Adds a task to the scene. More...
 
void Update (double delta_t)
 Executes all tasks held. More...
 

Protected Member Functions

virtual void End ()
 Ends the scene activity. More...
 

Detailed Description

A game scene, or screen.

Represents a scene, containing various graphical layers and sprites. A scene is game screen, such as a menu, or the playable part itself.

Constructor & Destructor Documentation

ugdk::action::Scene::Scene ( )
virtual ugdk::action::Scene::~Scene ( )
virtual

Member Function Documentation

bool ugdk::action::Scene::active ( ) const
inline
audio::Music* ugdk::action::Scene::background_music ( ) const
inline
virtual void ugdk::action::Scene::DeFocus ( )
virtual

Method called when this Scene leaves the top of the Scene stack.

virtual void ugdk::action::Scene::End ( )
protectedvirtual

Ends the scene activity.

Note: do not release any resources in this method.

system::EventHandler& ugdk::action::Scene::event_handler ( )
inline
const system::EventHandler& ugdk::action::Scene::event_handler ( ) const
inline
void ugdk::action::Scene::Finish ( )

Finishes the scene.

bool ugdk::action::Scene::finished ( ) const
inline
virtual void ugdk::action::Scene::Focus ( )
virtual

Method called when this Scene arrives on the top of the Scene stack.

const std::string& ugdk::action::Scene::identifier ( ) const
inline
MediaManager& ugdk::action::Scene::media_manager ( )
inline
const MediaManager& ugdk::action::Scene::media_manager ( ) const
inline
virtual void ugdk::action::Scene::OnPushed ( int  index)
inlinevirtual

Method called when this scene is pushed to the Engine's Scene stack.

Reimplemented in ugdk::action::mode3d::Scene3D.

void ugdk::action::Scene::Render ( graphic::Canvas ) const

Renders the scene to the given canvas if the scene is visible.

Uses the configurated renderfunction.

void ugdk::action::Scene::set_active ( bool  is_active)
inline
void ugdk::action::Scene::set_background_music ( audio::Music music)
inline
void ugdk::action::Scene::set_identifier ( const std::string &  new_identifier)
inline
void ugdk::action::Scene::set_render_function ( const std::function< void(graphic::Canvas &canvas)> &  render_function)
inline
void ugdk::action::Scene::set_visible ( bool  is_visible)
inline
void ugdk::action::Scene::StopsPreviousMusic ( bool  set)
inline

Whether this scene stops the previous music even if wont play any music.

void ugdk::action::Scene::Update ( double  delta_t)

Logical update of the scene.

Parameters
delta_tTime in seconds since last update
bool ugdk::action::Scene::visible ( ) const
inline

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