|
|
@ -44,6 +44,7 @@ void Textbox::Update(PixelGameEngine*pge){ |
|
|
|
} |
|
|
|
} |
|
|
|
displayText+=text[textboxMarker+1]; |
|
|
|
displayText+=text[textboxMarker+1]; |
|
|
|
textboxMarker++; |
|
|
|
textboxMarker++; |
|
|
|
|
|
|
|
maxSize.y=std::max(maxSize.y,float(pge->GetTextSizeProp(tempText).y)); |
|
|
|
} |
|
|
|
} |
|
|
|
lastLetterTime=letterDisplayDelay; |
|
|
|
lastLetterTime=letterDisplayDelay; |
|
|
|
} |
|
|
|
} |
|
|
@ -52,7 +53,7 @@ void Textbox::Update(PixelGameEngine*pge){ |
|
|
|
|
|
|
|
|
|
|
|
void Textbox::Draw(PixelGameEngine*pge,Resources&resources){ |
|
|
|
void Textbox::Draw(PixelGameEngine*pge,Resources&resources){ |
|
|
|
if(visible){ |
|
|
|
if(visible){ |
|
|
|
geom2d::rect<float>boxRect={pos-vf2d{2,2},maxSize+vf2d{4,4}}; |
|
|
|
geom2d::rect<float>boxRect={pos-vf2d{3,3},maxSize+vf2d{6,6}}; |
|
|
|
if(boxRect.bottom().start.y>=pge->ScreenHeight()){ |
|
|
|
if(boxRect.bottom().start.y>=pge->ScreenHeight()){ |
|
|
|
boxRect.pos-={0,boxRect.bottom().start.y-pge->ScreenHeight()}; |
|
|
|
boxRect.pos-={0,boxRect.bottom().start.y-pge->ScreenHeight()}; |
|
|
|
} |
|
|
|
} |
|
|
@ -65,8 +66,8 @@ void Textbox::Draw(PixelGameEngine*pge,Resources&resources){ |
|
|
|
if(boxRect.left().start.x<0){ |
|
|
|
if(boxRect.left().start.x<0){ |
|
|
|
boxRect.pos+={-boxRect.left().start.x,0}; |
|
|
|
boxRect.pos+={-boxRect.left().start.x,0}; |
|
|
|
} |
|
|
|
} |
|
|
|
pge->FillRectDecal(boxRect.pos,maxSize+vf2d{4,4},VERY_DARK_GREEN); |
|
|
|
pge->FillRectDecal(boxRect.pos,maxSize+vf2d{6,6},VERY_DARK_GREEN); |
|
|
|
pge->DrawRectDecal(boxRect.pos+vf2d{1,1},maxSize+vf2d{3,3},WHITE); |
|
|
|
pge->DrawRectDecal(boxRect.pos+vf2d{1,1},maxSize+vf2d{4,4},WHITE); |
|
|
|
pge->DrawShadowStringPropDecal(boxRect.pos+vf2d{3,3},displayText,{220,220,220}); |
|
|
|
pge->DrawShadowStringPropDecal(boxRect.pos+vf2d{3,3},displayText,{220,220,220}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|