Fix Perspective correction on ViewPort PGEX. Implement windowing system and remove sprite reliance from all menu components.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user