Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Panel Class Reference

Base class for Panel types. More...

#include <panel.h>

Inheritance diagram for Panel:

Inheritance graph
[legend]
List of all members.

Public Methods

 Panel ()
 Basic constructor. More...

 Panel (const unsigned int x, const unsigned int y, const unsigned int w, const unsigned int h)
 Constructor. More...

virtual ~Panel ()
 Destructor. More...

Panel & operator= (Panel const &other)
 Assignment operator.

virtual bool draw (SDL_Surface *screen)
 Draw the panel. More...

SDL_Rect * getDim ()
 Get the dimensions. More...

virtual void setFont (TTF_Font *font)

Protected Attributes

SDL_Rect dim
 Dimensions. More...

SDL_Surface * surface
 Drawing Surface. More...

TTF_Font * font
 Font of the info box. More...


Detailed Description

Base class for Panel types.

This is the super class for StatusPanel and InventoryPanel. It provides basic funcionality and data like the surface, font, and dimensions of the panel.


Constructor & Destructor Documentation

Panel::Panel  
 

Basic constructor.

This constructor does not do anything useful. Probably you shouldn't never use this one

Panel::Panel const unsigned int    x,
const unsigned int    y,
const unsigned int    w,
const unsigned int    h
 

Constructor.

This constructor creates a surface for this panel with the given dimensions and the format of the screen surface. Important: you can not call this constructor before initializing the video because it need to access the screen surface with SDL_GetVideoSurface();

Parameters:
x  x coordinate of the upper left corner of the surface
y  y coordinate of the upper left corner of the surface
w  width of the surface
h  height of the surface
font  pointer to a font.

Panel::~Panel   [virtual]
 

Destructor.

Frees the surface. It does not frees the font.


Member Function Documentation

bool Panel::draw SDL_Surface *    screen [virtual]
 

Draw the panel.

This is probably the only method that subclasses need to implement.

Returns:
true if the screen was updated

SDL_Rect * Panel::getDim  
 

Get the dimensions.

Returns:
a pointer to the dimensions of the surface


Member Data Documentation

SDL_Rect Panel::dim [protected]
 

Dimensions.

x, y, width, and height values of the surface. Very useful when you are drawing.

TTF_Font* Panel::font [protected]
 

Font of the info box.

It is defined with the constants FONT_SIZE and FONT_FILE in the class Graphics.

SDL_Surface* Panel::surface [protected]
 

Drawing Surface.

SDL Surface where we draw all the stuff in the panel


The documentation for this class was generated from the following files:
Generated on Thu Jun 6 17:22:23 2002 for Perihelion by doxygen1.2.15