src/gui/label.cpp

Go to the documentation of this file.
00001 #include "gui/gui.h"
00002 #include "gui/label.h"
00003 using namespace VGUI;
00004 
00005 
00006 Label::Label( Widget* w )
00007 {
00008         center = w->GetCenter();
00009         name = w->GetName();
00010         text = w->GetText();
00011         type = w->GetType();
00012         tip = w->GetTip();
00013         rel_width = w->GetRelWidth();
00014         rel_height = w->GetRelHeight();
00015         enabled = w->GetEnabled();
00016         selected = w->GetSelected();
00017         is_default = w->GetDefault();
00018         is_cancel = w->GetCancel();
00019         has_icon = w->GetHasIcon();
00020         width_auto = w->GetWidthAuto();
00021         height_auto = w->GetHeightAuto();
00022         font_size = w->GetFontSize();
00023         color_r = w->GetColorR();
00024         color_g = w->GetColorG();
00025         color_b = w->GetColorB();
00026 }
00027 
00028 Label::~Label()
00029 {
00030 }
00031 
00032 void Label::Draw()
00033 {
00034         Draw( 1.0 );
00035 }
00036 
00037 void Label::Draw( float opacity )
00038 {
00039         // draw text
00040         font.Print( center.GetXPercent() - ( font.Width( text.c_str(), 1, font_size ) / 2.0f ), center.GetYPercent() - ( font.Height( text.c_str(), 1, font_size ) / 2.0f ), text.c_str(), 1, font_size, color_r, color_g, color_b, 0.9 * opacity );
00041 }

Generated on Thu Oct 19 04:05:49 2006 by  doxygen 1.4.6