some bugfixes

This commit is contained in:
devZoGok
2021-10-30 08:48:21 +03:00
parent 179f4c28ac
commit 97275533c2
5 changed files with 21 additions and 19 deletions
+6 -5
View File
@@ -7,17 +7,18 @@ namespace game{
using namespace game::core;
Tooltip::Tooltip(vector2di pos, stringw entry){
this->pos=pos;
text=new BitmapText(entry,pos,GameManager::getSingleton()->getDevice()->getGUIEnvironment()->getFont(PATH + "Fonts/fontcourier.bmp"));
gameManager->attachBitmapText(text);
this->pos = pos;
GameManager *gm = GameManager::getSingleton();
text=new BitmapText(entry,pos,gm->getDevice()->getGUIEnvironment()->getFont(PATH + "Fonts/fontcourier.bmp"));
gm->attachBitmapText(text);
}
Tooltip::~Tooltip(){
gameManager->detachBitmapText(text);
GameManager::getSingleton()->detachBitmapText(text);
}
void Tooltip::update(){
IVideoDriver *driver=gameManager->getDevice()->getVideoDriver();
IVideoDriver *driver=GameManager::getSingleton()->getDevice()->getVideoDriver();
dimension2d<u32> dim=text->getFont()->getDimension(text->getText().c_str());
driver->draw2DRectangle(SColor(255,0,0,0),recti(pos.X,pos.Y,pos.X+dim.Width,pos.Y+dim.Height),nullptr);
driver->draw2DRectangleOutline(recti(pos-vector2di(1,1),dimension2df(dim.Width+1,dim.Height+1)),SColor(255,255,0,0));