35 ASSERT(dsc!=NULL,
"Nil icon descriptor.");
38 _isDiscarded = _isDiscarding = M_FALSE;
40 _ttAppear.parameters(2);
43 _ttDiscard.parameters(1);
44 _ttDiscard.enable(M_FALSE);
46 ticon3d_bg = _pSkin->parameter(
"TX_ICON3D").texture();
47 ticon3d_sel = _pSkin->parameter(
"TX_ICON3D_SEL").texture();
48 create(laPoint3(), laPoint3());
54 uiIcon3D::~uiIcon3D(
void)
59 void uiIcon3D::discardingIcon(M_BOOL bOn)
62 _ttDiscard.enable(bOn);
65 if(!bOn) _isDiscarded = M_FALSE;
70 ASSERT(_pDescriptor,
"Nil icon descriptor.");
72 laRenderer *pr = ::laSystemIntegrator::getRenderer();
73 laTimer *pt = ::laSystemIntegrator::getEnvironment()->getTimer();
80 if( !_ttAppear.isElapsed() )
82 alpha = (1-_ttAppear.reminder())*255;
85 if( _ttDiscard.isEnabled() )
87 alpha = _ttDiscard.reminder()*255;
88 scale = _ttDiscard.reminder();
92 pr->transTranslate(
_ptPos );
93 pr->transScale( laPoint3( scale, scale, 1) );
101 laColor col = _pSkin->parameter(
"CL_CONTAINER_SELECTED").color();
105 laPoint3(), laPoint3(ticon3d_sel.w, ticon3d_sel.h),
114 laColor col = _pSkin->parameter(
"CL_CONTAINER").color();
121 pr->
vquadsMakeXYRect(0, laPoint3((ticon3d_sel.w - ticon3d_bg.w)/2.0, (ticon3d_sel.h - ticon3d_bg.h)/2.0),
122 laPoint3(ticon3d_bg.w, ticon3d_bg.h),
134 pr->lightAmbient(0, laColor(100,100,100,255) );
135 pr->lightMakeSunlight(0, laPoint3( 0, 0, -2*
M_UNIT ) );
136 pr->styleSet( laColor(255,255,255,alpha) );
138 pr->transTranslate( laPoint3(ticon3d_sel.w*0.5, ticon3d_sel.h*0.5, 0) );
140 pr->styleSet( _pSkin->parameter(
"CL_LABEL_TXT").color() );
141 _pSkin->parameter(
"FN_DEFAULT").font()->ctlAlignH(
M_AL);
142 _pSkin->parameter(
"FN_DEFAULT").font()->ctlAlignV(
M_AB);
143 _pSkin->parameter(
"FN_DEFAULT").font()->ctlSize(12);
146 _pDescriptor->draw_description( laPoint3(ticon3d_sel.w*0.5, (
int)-0.5*ticon3d_sel.w), pr, _pSkin->parameter(
"FN_DEFAULT").font() );
148 pr->transScale( laPoint3( 1.2*ticon3d_bg.w/
M_UNIT, 1.2*ticon3d_bg.w/
M_UNIT, 1) );
150 _ang+= pt->delta()*15;
151 pr->transRotate( 25, laPoint3(0,0,1) );
152 pr->transRotate( _ang, laPoint3(0,1,0) );
155 _pDescriptor->draw_model( laPoint3(), pr );
166 ASSERT(_pDescriptor,
"Nil icon descriptor.");
172 if( _ttDiscard.isEnabled() )
173 scale = _ttDiscard.reminder();
176 laPoint3 ptDSz = _pDescriptor->description_size( _pSkin->parameter(
"FN_DEFAULT").font() );
178 _ptSize[0] = scale*(ticon3d_sel.w + ptDSz.x());
179 _ptSize[1] = scale*M_MAX(ticon3d_sel.h, ptDSz.y());
186 laTimer *pt = ::laSystemIntegrator::getEnvironment()->getTimer();
188 if( _ttDiscard.isEnabled() && _ttDiscard.isElapsed() )
189 _isDiscarded = M_TRUE;
191 _ttDiscard.animate(*pt);
192 _ttAppear.animate(*pt);
laPoint3 _ptPos
Windos position (relative to parent)
#define M_AB
Text align bottom.
virtual void reply()
Handle input message.
#define M_UNIT
Unit of 1 meter.
virtual void vquadsDrawSingle(laPoint2 *ar_uv=NULL)=0
Draw a single VQ (Note this is slower than drawing an array of VQ and should be avoided) ...
void vquadsMakeXYRect(unsigned nIndex, const laPoint3 &pos, const laPoint3 &sz, const laPoint2 &uv, const laPoint2 &uv_sz)
Makes a quad aligned to the XY plane; (handy for GUI rendering )
#define M_AL
Text align left.
Object outline properties.
laPoint3 _ptSize
Window size.
Abstract interface for icon descriptors; to be used in class uiIcon3D.
virtual void create(laPoint3 pos, laPoint3 size)
Create new empty window.
virtual void modeOutline(const laOutline &outline)
Set outline parameters.
virtual void modeDepthBuffer(M_BOOL bOn)=0
Enable/disable depth buffer.
Virtual interface for the Engine graphics renderer.
virtual void modeLight(M_BOOL bOn)=0
Enable/disable lighting.
virtual void draw()
Display the window.