Fix Perspective correction on ViewPort PGEX. Implement windowing system and remove sprite reliance from all menu components.

This commit is contained in:
2023-12-14 04:18:05 -06:00
parent 4bab1397dc
commit 7a46f79f2b
24 changed files with 225 additions and 278 deletions
+4 -4
View File
@@ -55,10 +55,10 @@ protected:
MenuIconButton::Update(game);
animationTime+=game->GetElapsedTime();
}
virtual inline void Draw(Crawler*game,vf2d parentPos)override{
MenuComponent::Draw(game,parentPos); //INTENTIONAL! The way we draw animations is different from static images, we skip over MenuIconButton's draw!
Sprite*spr=ANIMATION_DATA[animation].GetFrame(animationTime).GetSourceImage()->Sprite();
virtual inline void DrawDecal(ViewPort&window,vf2d parentPos,bool focused)override{
MenuComponent::DrawDecal(window,parentPos,focused); //INTENTIONAL! The way we draw animations is different from static images, we skip over MenuIconButton's draw!
Decal*spr=ANIMATION_DATA[animation].GetFrame(animationTime).GetSourceImage()->Decal();
geom2d::rect<int>sprRect=ANIMATION_DATA[animation].GetFrame(animationTime).GetSourceRect();
game->DrawPartialSprite(parentPos+rect.middle()-sprRect.size/2,spr,sprRect.pos,sprRect.size,1,Sprite::Flip::NONE);
window.DrawPartialDecal(parentPos+rect.middle()-sprRect.size/2,spr,sprRect.pos,sprRect.size);
}
};