diff --git a/Makefile b/Makefile index 06056c415..2cd5deee4 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,18 @@ export DESTINCDIR = $(DESTDIR)/include STRLOWERCASE = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1)))))))))))))))))))))))))) OS = $(strip $(call STRLOWERCASE, $(shell uname) ) ) +ifeq ($(OS), linux) +LIBS = -lfreetype -lSDL -lsndfile -lopenal -lGL -lGLU +LIBSIV = -lX11 -lXcursor +OTHERINC = -I/usr/include/freetype2 +else +ifeq ($(OS), darwin) +LIBS = -lfreetype -lSDL -lSDLmain -lsndfile -framework OpenGL -framework GLUT -framework OpenAL -framework Cocoa -framework CoreFoundation +LIBSIV = +OTHERINC = -I/usr/include/freetype2 +endif +endif + EXE = eetest-$(RELEASETYPE) EXEIV = eeiv-$(RELEASETYPE) @@ -140,32 +152,32 @@ dirs: lib: dirs $(LIB) $(FOBJMODULES): - $(CPP) -o $@ -c $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(CFLAGS) -I/usr/include/freetype2 - @$(CPP) -MT $@ -MM $(patsubst $(OBJDIR)%.o,%.cpp,$@) -I/usr/include/freetype2 > $(patsubst %.o,%.d,$@) + $(CPP) -o $@ -c $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(CFLAGS) $(OTHERINC) + @$(CPP) -MT $@ -MM $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(OTHERINC) > $(patsubst %.o,%.d,$@) $(FOBJHELPERS): $(CC) -o $@ -c $(patsubst $(OBJDIR)%.o,%.c,$@) $(CFLAGSEXT) -DSTBI_FAILURE_USERMSG @$(CC) -MT $@ -MM $(patsubst $(OBJDIR)%.o,%.c,$@) -DSTBI_FAILURE_USERMSG > $(patsubst %.o,%.d,$@) $(FOBJTEST): - $(CPP) -o $@ -c $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(CFLAGS) -I/usr/include/freetype2 - @$(CPP) -MT $@ -MM $(patsubst $(OBJDIR)%.o,%.cpp,$@) -I/usr/include/freetype2 > $(patsubst %.o,%.d,$@) + $(CPP) -o $@ -c $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(CFLAGS) $(OTHERINC) + @$(CPP) -MT $@ -MM $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(OTHERINC) > $(patsubst %.o,%.d,$@) $(FOBJEEIV): - $(CPP) -o $@ -c $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(CFLAGS) -I/usr/include/freetype2 - @$(CPP) -MT $@ -MM $(patsubst $(OBJDIR)%.o,%.cpp,$@) -I/usr/include/freetype2 > $(patsubst %.o,%.d,$@) + $(CPP) -o $@ -c $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(CFLAGS) $(OTHERINC) + @$(CPP) -MT $@ -MM $(patsubst $(OBJDIR)%.o,%.cpp,$@) $(OTHERINC) > $(patsubst %.o,%.d,$@) $(EXEIV): $(FOBJHELPERS) $(FOBJMODULES) $(FOBJEEIV) - $(CPP) -o ./$(EXEIV) $(FOBJHELPERS) $(FOBJMODULES) $(FOBJEEIV) $(LDFLAGS) -lfreetype -lSDL -lsndfile -lopenal -lGL -lGLU -lX11 -lXcursor + $(CPP) -o ./$(EXEIV) $(FOBJHELPERS) $(FOBJMODULES) $(FOBJEEIV) $(LDFLAGS) $(LIBS) $(LIBSIV) $(EXE): $(FOBJHELPERS) $(FOBJMODULES) $(FOBJTEST) - $(CPP) -o ./$(EXE) $(FOBJHELPERS) $(FOBJMODULES) $(FOBJTEST) $(LDFLAGS) -lfreetype -lSDL -lsndfile -lopenal -lGL -lGLU + $(CPP) -o ./$(EXE) $(FOBJHELPERS) $(FOBJMODULES) $(FOBJTEST) $(LDFLAGS) $(LIBS) libeepp-s.a: $(FOBJHELPERS) $(FOBJMODULES) $(AR) $(ARFLAGS) $(LIBNAME) $(FOBJHELPERS) $(FOBJMODULES) libeepp.so: $(FOBJHELPERS) $(FOBJMODULES) - $(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(FOBJHELPERS) $(FOBJMODULES) -lfreetype -lSDL -lsndfile -lopenal -lGL -lGLU + $(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(FOBJHELPERS) $(FOBJMODULES) $(LIBS) os: @echo $(OS) diff --git a/src/graphics/fonthelper.hpp b/src/graphics/fonthelper.hpp index ef7e9ab12..d09a1458b 100644 --- a/src/graphics/fonthelper.hpp +++ b/src/graphics/fonthelper.hpp @@ -3,19 +3,23 @@ namespace EE { namespace Graphics { -#define FONT_DRAW_LEFT (0 << 0) -#define FONT_DRAW_RIGHT (1 << 0) -#define FONT_DRAW_CENTER (2 << 0) -#define FONT_DRAW_HALIGN_MASK (3 << 0) +enum FONT_HALIGN { + FONT_DRAW_LEFT = (0 << 0), + FONT_DRAW_RIGHT = (1 << 0), + FONT_DRAW_CENTER = (2 << 0), + FONT_DRAW_HALIGN_MASK = (3 << 0) +}; inline Uint32 FontHAlignGet( Uint32 Flags ) { return Flags & FONT_DRAW_HALIGN_MASK; } -#define FONT_DRAW_TOP (0 << 2) -#define FONT_DRAW_BOTTOM (1 << 2) -#define FONT_DRAW_MIDDLE (2 << 2) -#define FONT_DRAW_VALIGN_MASK (3 << 2) +enum FONT_VALIGN { + FONT_DRAW_TOP = (0 << 2), + FONT_DRAW_BOTTOM = (1 << 2), + FONT_DRAW_MIDDLE = (2 << 2), + FONT_DRAW_VALIGN_MASK = (3 << 2) +}; inline Uint32 FontVAlignGet( Uint32 Flags ) { return Flags & FONT_DRAW_VALIGN_MASK; @@ -24,7 +28,6 @@ inline Uint32 FontVAlignGet( Uint32 Flags ) { #define FONT_DRAW_SHADOW (1 << 5) #define FONT_DRAW_ALIGN_MASK ( FONT_DRAW_VALIGN_MASK | FONT_DRAW_HALIGN_MASK ) - /** Basic Glyph structure used by the engine */ typedef struct eeGlyphS { Int32 MinX, MaxX, MinY, MaxY, Advance; diff --git a/src/test/ee.cpp b/src/test/ee.cpp index e591e37b6..f63644612 100644 --- a/src/test/ee.cpp +++ b/src/test/ee.cpp @@ -194,12 +194,14 @@ class cEETest : private cThread { cFrameBuffer * mFB; cVertexBuffer * mVBO; + void ItemClick( const cUIEvent * Event ); void MainClick( const cUIEvent * Event ); void QuitClick( const cUIEvent * Event ); void ButtonClick( const cUIEvent * Event ); void OnValueChange( const cUIEvent * Event ); void CreateAquaTextureAtlas(); + cUIControlAnim * C; cUIScrollBar * mScrollBar; cUITextBox * mTextBoxValue; cUISlider * mSlider; @@ -401,7 +403,7 @@ void cEETest::CreateUI() { Params.Border.Width( 2 ); Params.Border.Color( 0xFF979797 ); Params.Background.Colors( eeColorA( 0x66EDEDED ), eeColorA( 0xCCEDEDED ), eeColorA( 0xCCEDEDED ), eeColorA( 0x66EDEDED ) ); - cUIControlAnim * C = eeNew( cUITest, ( Params ) ); + C = eeNew( cUITest, ( Params ) ); C->Visible( true ); C->Enabled( true ); C->Pos( 320, 240 ); @@ -624,14 +626,18 @@ void cEETest::CreateUI() { MenuParams.MinSpaceForIcons = 16; MenuParams.PosSet( 0, 0 ); MenuParams.FontSelectedColor = eeColorA( 255, 255, 255, 255 ); + MenuParams.MinRightMargin = 8; Menu = eeNew( cUIPopUpMenu, ( MenuParams ) ); Menu->Add( L"New", cGlobalShapeGroup::instance()->GetByName( "aqua_button_ok" ) ); Menu->Add( L"Open..." ); Menu->AddSeparator(); - Menu->Add( L"Save" ); - Menu->Add( L"Save As..." ); - Menu->Add( L"Save All" ); - Menu->AddCheckBox( L"Check Me" ); + Menu->Add( L"Show Screen 1" ); + Menu->Add( L"Show Screen 2" ); + Menu->Add( L"Show Screen 3" ); + Menu->AddSeparator(); + Menu->AddCheckBox( L"Show Window" ); + Menu->AddCheckBox( L"Multi Viewport" ); + reinterpret_cast ( Menu->GetItem( L"Show Window" ) )->Active( true ); cUIPopUpMenu * Menu3 = eeNew( cUIPopUpMenu, ( MenuParams ) ); Menu3->Add( L"Hello World 1" ); @@ -646,11 +652,13 @@ void cEETest::CreateUI() { Menu2->Add( L"Test 4" ); Menu2->AddSubMenu( L"Hello World", NULL, Menu3 ); + Menu->AddSeparator(); Menu->AddSubMenu( L"Teh Menuh", NULL, Menu2 ) ; Menu->AddSeparator(); Menu->Add( L"Quit" ); + Menu->AddEventListener( cUIEvent::EventOnItemClicked, cb::Make1( this, &cEETest::ItemClick ) ); Menu->GetItem( L"Quit" )->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cEETest::QuitClick ) ); cUIManager::instance()->MainControl()->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cEETest::MainClick ) ); @@ -666,6 +674,33 @@ void cEETest::CreateUI() { mInfoText.Create( FF, L"", eeColorA(255,255,255,150) ); } +void cEETest::ItemClick( const cUIEvent * Event ) { + if ( !Event->Ctrl()->IsType( UI_TYPE_MENUITEM ) ) + return; + + const std::wstring& txt = reinterpret_cast ( Event->Ctrl() )->Text(); + + if ( L"Show Screen 1" == txt ) { + Screen = 0; + } else if ( L"Show Screen 2" == txt ) { + Screen = 1; + } else if ( L"Show Screen 3" == txt ) { + Screen = 2; + } else if ( L"Show Window" == txt ) { + cUIMenuCheckBox * Chk = reinterpret_cast ( Event->Ctrl() ); + + if ( !Chk->Active() ) { + C->StartScaleAnim( C->Scale(), 1.f, 500.f, SINEOUT ); + C->StartAlphaAnim( C->Alpha(), 255.f, 500.f ); + } else { + C->StartScaleAnim( C->Scale(), 0.f, 500.f, SINEIN ); + C->StartAlphaAnim( C->Alpha(), 0.f, 500.f ); + } + } else if ( L"Multi Viewport" == txt ) { + MultiViewportMode = !MultiViewportMode; + } +} + void cEETest::OnValueChange( const cUIEvent * Event ) { mTextBoxValue->Text( L"Scroll Value:\n" + toWStr( mScrollBar->Value() ) ); diff --git a/src/ui/cuicontrolanim.cpp b/src/ui/cuicontrolanim.cpp index f53deb5f6..0b67c80aa 100644 --- a/src/ui/cuicontrolanim.cpp +++ b/src/ui/cuicontrolanim.cpp @@ -26,7 +26,7 @@ cUIControlAnim::~cUIControlAnim() { void cUIControlAnim::Draw() { - if ( mVisible ) { + if ( mVisible && 0.f != mAlpha ) { if ( mFlags & UI_FILL_BACKGROUND ) BackgroundDraw(); diff --git a/src/ui/cuigfx.cpp b/src/ui/cuigfx.cpp index 4346c8ecd..1d32d5a8c 100644 --- a/src/ui/cuigfx.cpp +++ b/src/ui/cuigfx.cpp @@ -38,7 +38,7 @@ void cUIGfx::Draw() { cUIControlAnim::Draw(); if ( mVisible ) { - if ( NULL != mShape ) + if ( NULL != mShape && 0.f != mAlpha ) mShape->Draw( (eeFloat)mScreenPos.x, (eeFloat)mScreenPos.y, mColor, 0.f, 1.f, mBlend, mRender ); } } diff --git a/src/ui/cuimenu.cpp b/src/ui/cuimenu.cpp index 6b96b768c..d1406232e 100644 --- a/src/ui/cuimenu.cpp +++ b/src/ui/cuimenu.cpp @@ -13,6 +13,7 @@ cUIMenu::cUIMenu( cUIMenu::CreateParams& Params ) : mFontSelectedColor( Params.FontSelectedColor ), mMinWidth( Params.MinWidth ), mMinSpaceForIcons( Params.MinSpaceForIcons ), + mMinRightMargin( Params.MinRightMargin ), mMaxWidth( 0 ), mRowHeight( Params.RowHeight ), mNextPosY( 0 ), @@ -131,8 +132,8 @@ bool cUIMenu::CheckControlSize( cUIControl * Control, const bool& Resize ) { if ( Control->IsType( UI_TYPE_MENUSUBMENU ) ) { cUIMenuSubMenu * tMenu = reinterpret_cast ( tItem ); - if ( tMenu->TextBox()->GetTextWidth() + mBiggestIcon + tMenu->Arrow()->Size().Width() > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { - mMaxWidth = tMenu->TextBox()->GetTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + tMenu->Arrow()->Size().Width(); + if ( tMenu->TextBox()->GetTextWidth() + mBiggestIcon + tMenu->Arrow()->Size().Width() + mMinRightMargin > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { + mMaxWidth = tMenu->TextBox()->GetTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + tMenu->Arrow()->Size().Width() + mMinRightMargin; if ( Resize ) { ResizeControls(); @@ -142,8 +143,8 @@ bool cUIMenu::CheckControlSize( cUIControl * Control, const bool& Resize ) { } } else { - if ( tItem->TextBox()->GetTextWidth() + mBiggestIcon > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { - mMaxWidth = tItem->TextBox()->GetTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right; + if ( tItem->TextBox()->GetTextWidth() + mBiggestIcon + mMinRightMargin > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { + mMaxWidth = tItem->TextBox()->GetTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + mMinRightMargin; if ( Resize ) { ResizeControls(); @@ -527,24 +528,72 @@ Uint32 cUIMenu::OnKeyDown( const cUIEventKey& Event ) { return 1; } -void cUIMenu::FixMenuPos( eeVector2i& Pos, cUIMenu * Menu ) { +const eeRecti& cUIMenu::Padding() const { + return mPadding; +} + +void cUIMenu::FixMenuPos( eeVector2i& Pos, cUIMenu * Menu, cUIMenu * Parent, cUIMenuSubMenu * SubMenu ) { eeAABB qScreen( 0.f, 0.f, cUIManager::instance()->MainControl()->Size().Width(), cUIManager::instance()->MainControl()->Size().Height() ); eeAABB qPos( Pos.x, Pos.y, Pos.x + Menu->Size().Width(), Pos.y + Menu->Size().Height() ); - if ( !qScreen.Contains( qPos ) ) { - Pos.y -= Menu->Size().Height(); - qPos.Top -= Menu->Size().Height(); - qPos.Bottom -= Menu->Size().Height(); + if ( NULL != Parent && NULL != SubMenu ) { + eeVector2i addToPos( 0, 0 ); + + if ( NULL != SubMenu ) { + addToPos.y = SubMenu->Size().Height(); + } + + eeVector2i sPos = SubMenu->Pos(); + SubMenu->ControlToScreen( sPos ); + + eeVector2i pPos = Parent->Pos(); + Parent->ControlToScreen( pPos ); + + eeAABB qParent( pPos.x, pPos.y, pPos.x + Parent->Size().Width(), pPos.y + Parent->Size().Height() ); + + Pos.x = qParent.Right; + Pos.y = sPos.y; + qPos.Left = Pos.x; + qPos.Right = qPos.Left + Menu->Size().Width(); + qPos.Top = Pos.y; + qPos.Bottom = qPos.Top + Menu->Size().Height(); if ( !qScreen.Contains( qPos ) ) { - Pos.x -= Menu->Size().Width(); - qPos.Left -= Menu->Size().Width(); - qPos.Right -= Menu->Size().Width(); + Pos.y = sPos.y + SubMenu->Size().Height() - Menu->Size().Height(); + qPos.Top = Pos.y; + qPos.Bottom = qPos.Top + Menu->Size().Height(); if ( !qScreen.Contains( qPos ) ) { - Pos.y += Menu->Size().Height() * 2; - //qPos.Top += Menu->Size().Height() * 2; - //qPos.Bottom += Menu->Size().Height() * 2; + Pos.x = qParent.Left - Menu->Size().Width(); + Pos.y = sPos.y; + qPos.Left = Pos.x; + qPos.Right = qPos.Left + Menu->Size().Width(); + qPos.Top = Pos.y; + qPos.Bottom = qPos.Top + Menu->Size().Height(); + + if ( !qScreen.Contains( qPos ) ) { + Pos.y = sPos.y + SubMenu->Size().Height() - Menu->Size().Height(); + qPos.Top = Pos.y; + qPos.Bottom = qPos.Top + Menu->Size().Height(); + } + } + } + } else { + if ( !qScreen.Contains( qPos ) ) { + Pos.y -= Menu->Size().Height(); + qPos.Top -= Menu->Size().Height(); + qPos.Bottom -= Menu->Size().Height(); + + if ( !qScreen.Contains( qPos ) ) { + Pos.x -= Menu->Size().Width(); + qPos.Left -= Menu->Size().Width(); + qPos.Right -= Menu->Size().Width(); + + if ( !qScreen.Contains( qPos ) ) { + Pos.y += Menu->Size().Height(); + qPos.Top += Menu->Size().Height(); + qPos.Bottom += Menu->Size().Height(); + } } } } diff --git a/src/ui/cuimenu.hpp b/src/ui/cuimenu.hpp index 626d56b1e..fb28ff01b 100644 --- a/src/ui/cuimenu.hpp +++ b/src/ui/cuimenu.hpp @@ -22,7 +22,8 @@ class EE_API cUIMenu : public cUIControlAnim { FontOverColor( 0, 0, 0, 255 ), FontSelectedColor( 0, 0, 0, 255 ), MinWidth( 0 ), - MinSpaceForIcons( 0 ) + MinSpaceForIcons( 0 ), + MinRightMargin( 0 ) { cUITheme * Theme = cUIThemeManager::instance()->DefaultTheme(); @@ -50,10 +51,11 @@ class EE_API cUIMenu : public cUIControlAnim { eeColorA FontSelectedColor; Uint32 MinWidth; Uint32 MinSpaceForIcons; + Uint32 MinRightMargin; }; - static void FixMenuPos( eeVector2i& Pos, cUIMenu * Menu ); + static void FixMenuPos( eeVector2i& Pos, cUIMenu * Menu, cUIMenu * Parent = NULL, cUIMenuSubMenu * SubMenu = NULL ); cUIMenu( cUIMenu::CreateParams& Params ); @@ -92,6 +94,8 @@ class EE_API cUIMenu : public cUIControlAnim { virtual bool Show(); virtual bool Hide(); + + const eeRecti& Padding() const; protected: friend class cUIMenuItem; friend class cUIMenuCheckBox; @@ -106,6 +110,7 @@ class EE_API cUIMenu : public cUIControlAnim { eeColorA mFontSelectedColor; Uint32 mMinWidth; Uint32 mMinSpaceForIcons; + Uint32 mMinRightMargin; Uint32 mMaxWidth; Uint32 mRowHeight; Uint32 mNextPosY; diff --git a/src/ui/cuimenusubmenu.cpp b/src/ui/cuimenusubmenu.cpp index 2404a0dd1..4c9a09361 100644 --- a/src/ui/cuimenusubmenu.cpp +++ b/src/ui/cuimenusubmenu.cpp @@ -97,9 +97,9 @@ void cUIMenuSubMenu::ShowSubMenu() { eeVector2i Pos = this->Pos(); ControlToScreen( Pos ); - Pos.x += mSize.Width(); + Pos.x += mSize.Width() + reinterpret_cast ( Parent() )->Padding().Right; - cUIMenu::FixMenuPos( Pos, mSubMenu ); + cUIMenu::FixMenuPos( Pos, mSubMenu, reinterpret_cast ( Parent() ), this ); mSubMenu->Parent()->ScreenToControl( Pos ); mSubMenu->Pos( Pos ); diff --git a/src/ui/cuiprogressbar.cpp b/src/ui/cuiprogressbar.cpp index 007a3f517..9a9c84141 100644 --- a/src/ui/cuiprogressbar.cpp +++ b/src/ui/cuiprogressbar.cpp @@ -35,7 +35,7 @@ cUIProgressBar::~cUIProgressBar() { void cUIProgressBar::Draw() { cUIControlAnim::Draw(); - if ( NULL != mParallax ) { + if ( NULL != mParallax && 0.f != mAlpha ) { mParallax->Position( eeVector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ) ); mParallax->Draw(); } diff --git a/src/ui/cuiskincomplex.cpp b/src/ui/cuiskincomplex.cpp index 8bfbda7c8..a81d69515 100644 --- a/src/ui/cuiskincomplex.cpp +++ b/src/ui/cuiskincomplex.cpp @@ -28,6 +28,9 @@ cUISkinComplex::~cUISkinComplex() { } void cUISkinComplex::Draw( const eeFloat& X, const eeFloat& Y, const eeFloat& Width, const eeFloat& Height, const Uint32& Alpha, const Uint32& State ) { + if ( 0 == Alpha ) + return; + cShape * tShape = mShape[ State ][ UpLeft ]; mTempColor = mColor[ State ]; diff --git a/src/ui/cuiskinsimple.cpp b/src/ui/cuiskinsimple.cpp index 0aed0f354..437cedf84 100644 --- a/src/ui/cuiskinsimple.cpp +++ b/src/ui/cuiskinsimple.cpp @@ -16,6 +16,9 @@ cUISkinSimple::~cUISkinSimple() { } void cUISkinSimple::Draw( const eeFloat& X, const eeFloat& Y, const eeFloat& Width, const eeFloat& Height, const Uint32& Alpha, const Uint32& State ) { + if ( 0 == Alpha ) + return; + cShape * tShape = mShape[ State ]; mTempColor = mColor[ State ]; diff --git a/src/ui/cuisprite.cpp b/src/ui/cuisprite.cpp index 358779f91..445948539 100644 --- a/src/ui/cuisprite.cpp +++ b/src/ui/cuisprite.cpp @@ -29,7 +29,7 @@ void cUISprite::Draw() { cUIControlAnim::Draw(); if ( mVisible ) { - if ( NULL != mSprite ) { + if ( NULL != mSprite && 0.f != mAlpha ) { UpdateSize(); mSprite->UpdatePos( (eeFloat)mScreenPos.x, (eeFloat)mScreenPos.y ); mSprite->Draw( mBlend, mRender ); diff --git a/src/ui/cuitextbox.cpp b/src/ui/cuitextbox.cpp index a09ff658f..099a45df6 100644 --- a/src/ui/cuitextbox.cpp +++ b/src/ui/cuitextbox.cpp @@ -32,7 +32,7 @@ cUITextBox::~cUITextBox() { } void cUITextBox::Draw() { - if ( mVisible ) { + if ( mVisible && 0.f != mAlpha ) { cUIControlAnim::Draw(); if ( mTextCache->GetTextWidth() ) {