parent
f365e342a2
commit
6bed39f178
@ -0,0 +1,11 @@ |
|||||||
|
#include "DebuffIcon.h" |
||||||
|
|
||||||
|
void DebuffIcon::Update(float fElapsedTime){ |
||||||
|
pos.y-=6*fElapsedTime; |
||||||
|
lifetime-=fElapsedTime; |
||||||
|
} |
||||||
|
|
||||||
|
void DebuffIcon::Draw(TileTransformedView&game){ |
||||||
|
game.DrawRotatedDecal(pos,icon->Decal(),0,icon->Sprite()->Size()/2,{1,1},{255,255,255,uint8_t((lifetime/CONSTANT::DEBUFFICON_LIFETIME)*255)}); |
||||||
|
game.DrawRotatedDecal(pos+vf2d{4,-4},redXIcon->Decal(),0,icon->Sprite()->Size()/2,{1,1},{255,255,255,uint8_t((lifetime/CONSTANT::DEBUFFICON_LIFETIME)*255)}); |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
#pragma once |
||||||
|
#include "olcPixelGameEngine.h" |
||||||
|
#include "olcPGEX_TransformedView.h" |
||||||
|
#include "Constant.h" |
||||||
|
|
||||||
|
struct DebuffIcon{ |
||||||
|
Renderable*icon; |
||||||
|
Renderable*redXIcon; |
||||||
|
vf2d pos; |
||||||
|
float lifetime=CONSTANT::DEBUFFICON_LIFETIME; |
||||||
|
void Update(float fElapsedTime); |
||||||
|
void Draw(TileTransformedView&game); |
||||||
|
}; |
Loading…
Reference in new issue