UGDK  0.4.1
 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>

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.
 
virtual void DeFocus ()
 Method called when this Scene leaves the top of the Scene stack.
 
void AddEntity (Entity *entity)
 Adds an Entity to the scene.
 
void RemoveEntity (Entity *entity)
 Removes the specified Entity from the scene.
 
void QueuedAddEntity (Entity *entity)
 Will be added at the end of the.
 
void RemoveAllEntities ()
 
void AddTask (Task *task)
 Adds a Task to the scene.
 
void Finish ()
 Finishes the scene.
 
void Update (double delta_t)
 Logical update of the scene.
 
void StopsPreviousMusic (bool set)
 Whether this scene stops the previous music even if wont play any music.
 
void set_defocus_callback (std::tr1::function< void(Scene *)> defocus_callback)
 
void set_focus_callback (std::tr1::function< void(Scene *)> focus_callback)
 
Getters and Setters
bool finished () const
 
graphic::Nodecontent_node ()
 
const graphic::Nodecontent_node () const
 
graphic::Nodeinterface_node ()
 
const graphic::Nodeinterface_node () const
 
Musicbackground_music () const
 
void set_background_music (Music *music)
 

Protected Member Functions

virtual void End ()
 Ends the scene activity.
 

Protected Attributes

bool finished_
 Tells whether scene is finished or not.
 
Musicbackground_music_
 The background music when this scene is on top.
 

Friends

class Engine
 

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 ( )
ugdk::action::Scene::~Scene ( )
virtual

Member Function Documentation

void ugdk::action::Scene::AddEntity ( Entity entity)

Adds an Entity to the scene.

void ugdk::action::Scene::AddTask ( Task task)

Adds a Task to the scene.

Music* ugdk::action::Scene::background_music ( ) const
inline
graphic::Node* ugdk::action::Scene::content_node ( )
inline
const graphic::Node* ugdk::action::Scene::content_node ( ) const
inline
void ugdk::action::Scene::DeFocus ( )
virtual

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

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

Ends the scene activity.

Note: do not release any resources in this method.

void ugdk::action::Scene::Finish ( )
inline

Finishes the scene.

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

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

graphic::Node* ugdk::action::Scene::interface_node ( )
inline
const graphic::Node* ugdk::action::Scene::interface_node ( ) const
inline
void ugdk::action::Scene::QueuedAddEntity ( Entity entity)
inline

Will be added at the end of the.

void ugdk::action::Scene::RemoveAllEntities ( )
void ugdk::action::Scene::RemoveEntity ( Entity entity)
inline

Removes the specified Entity from the scene.

void ugdk::action::Scene::set_background_music ( Music music)
inline
void ugdk::action::Scene::set_defocus_callback ( std::tr1::function< void(Scene *)>  defocus_callback)
inline
void ugdk::action::Scene::set_focus_callback ( std::tr1::function< void(Scene *)>  focus_callback)
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

Friends And Related Function Documentation

friend class Engine
friend

Member Data Documentation

Music* ugdk::action::Scene::background_music_
protected

The background music when this scene is on top.

bool ugdk::action::Scene::finished_
protected

Tells whether scene is finished or not.


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