33 uiDialogBaloon::uiDialogBaloon(
void)
35 _pAnimatedText = NULL;
39 uiDialogBaloon::~uiDialogBaloon(
void)
45 void uiDialogBaloon::init()
50 tbg = _pSkin->parameter(
"TX_BALOON_WNDBG").texture();
51 tborder_h = _pSkin->parameter(
"TX_BALOON_WNDBR_H").texture();
52 tborder_v = _pSkin->parameter(
"TX_BALOON_WNDBR_V").texture();
53 tangle = _pSkin->parameter(
"TX_BALOON_WNDAN").texture();
55 col = _pSkin->parameter(
"CL_BALOON").color();
56 ptShadowOffset[0] = _pSkin->parameter(
"BALOON_SHADOW_OFFSETX").dval();
57 ptShadowOffset[1] = _pSkin->parameter(
"BALOON_SHADOW_OFFSETX").dval();
62 void uiDialogBaloon::drawBorders()
64 glEnable(GL_STENCIL_TEST);
65 glStencilFunc(GL_ALWAYS, 1 , 0xFFF );
66 glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
67 glDisable(GL_DEPTH_TEST);
69 uiContainer::drawBorders();
71 laPoint3 pos = getPos();
72 laPoint3 size = getSize();
78 laRenderer *r = laSystemIntegrator::getRenderer();
82 glBegin(GL_TRIANGLES);
83 glVertex2f( _ptMouthPos.x(), _ptMouthPos.y() );
84 glVertex2f( M_MIN(pos.x() + 40, pos.x() + size.x()/2 - 40), pos.y() + size.y() - 1);
85 glVertex2f( pos.x(), pos.y() + size.y() - 1);
88 glDisable(GL_STENCIL_TEST);
92 void uiDialogBaloon::reply()
96 if(_pAnimatedText) _pAnimatedText->animate( *(laSystemIntegrator::getEnvironment()->getTimer()) );
99 void uiDialogBaloon::draw()
101 laRenderer *r = laSystemIntegrator::getRenderer();
102 double scale =
M_UNIT*0.005;
108 _ptMouthPos /= scale;
109 if(_pAnimatedText) _pAnimatedText->fontSz( _pAnimatedText->getFontSz()/scale );
112 r->transScale( laPoint3(scale, scale, 1) );
120 switch( _pAnimatedText->fontAlign() )
122 case M_AL: ofs = 0;
break;
123 case M_AC: ofs = getSize().x()/2;
break;
124 case M_AR: ofs = getSize().x();
break;
127 _pAnimatedText->draw( r, getPos()
128 + laPoint3(ofs + (_ptSize.x() - _pAnimatedText->width())/2.0,
129 (_ptSize.y() - _pAnimatedText->height())/2.0 )
139 _ptMouthPos *= scale;
141 if(_pAnimatedText) _pAnimatedText->fontSz( _pAnimatedText->getFontSz()*scale );
virtual void modeTexture(M_BOOL bOn)=0
Enable/disable texturing.
#define M_UNIT
Unit of 1 meter.
#define M_AL
Text align left.
#define M_AR
Text align right.
virtual void draw()
Display the window.
#define M_AC
Text align center.
Virtual interface for the Engine graphics renderer.
virtual void modeLight(M_BOOL bOn)=0
Enable/disable lighting.
virtual void reply()
Handle input message.