generated from sigonasr2/CPlusPlusProjectTemplate
Cursor animation flip
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
998d695cd6
commit
29a57f5850
Binary file not shown.
BIN
assets/crosshair.png
Normal file
BIN
assets/crosshair.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 659 B |
19
main.cpp
19
main.cpp
@ -550,6 +550,7 @@ public:
|
||||
std::vector<Particle*> PARTICLES;
|
||||
std::vector<DamageNumber*> DAMAGE_NUMBERS;
|
||||
std::map<std::pair<int,int>,vd2d> MOVEMENT_GRID;
|
||||
vi2d SELECTED_MOVE_SQUARE;
|
||||
|
||||
Effect*CURRENT_EFFECT=nullptr;
|
||||
|
||||
@ -1026,6 +1027,7 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
case 4:{ //Move selected.
|
||||
//DisplayMessageBox("Not implemented yet.");
|
||||
BATTLE_STATE=BattleState::MOVE_SELECT;
|
||||
SELECTED_MOVE_SQUARE={0,0};
|
||||
PopulateMovementGrid(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->obj->GetPosWithOrigin(),PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->speed/2);
|
||||
}break;
|
||||
case 5:{ //Run selected.
|
||||
@ -1653,6 +1655,20 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////INTERFACE LAYER.
|
||||
SetDrawTarget(layer::INTERFACE);
|
||||
|
||||
if (BATTLE_ENCOUNTER!=nullptr&&BATTLE_STATE==BattleState::MOVE_SELECT) {
|
||||
vd2d cursorOffset = {-2,-2};
|
||||
vd2d cursorScale = {1,1};
|
||||
if ((cos(frameCount*M_PI/20)/2+0.5)>0.8) {
|
||||
cursorScale={1.08F,1.08F};
|
||||
cursorOffset.x-=36*0.08;
|
||||
cursorOffset.y-=36*0.08;
|
||||
}
|
||||
DrawDecal((vi2d)((PARTY_MEMBER_OBJ[-CURRENT_TURN-1]->GetPosWithOrigin()-cameraPos)/32)*32+cursorOffset,SPRITES["crosshair.png"],cursorScale);
|
||||
}
|
||||
for (auto numb:DAMAGE_NUMBERS) {
|
||||
vd2d shadowOffset={1,1};
|
||||
vd2d textSize = GetTextSizeProp((numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage));
|
||||
@ -1661,11 +1677,9 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
DrawStringPropDecal(numb->pos-cameraPos-textSize/2,(numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage),Pixel(255,255,255,abs(sin((M_PI*frameCount)/30)*128)),{1,2});
|
||||
}
|
||||
if (messageBoxVisible) {
|
||||
SetDrawTarget(layer::INTERFACE);
|
||||
DrawDialogBox({1,1},{WIDTH/2,HEIGHT/4},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128));
|
||||
DrawStringPropDecal({6,6},messageBoxText);
|
||||
}
|
||||
SetDrawTarget(layer::INTERFACE);
|
||||
for (int i=0;i<PARTICLES.size();i++) {
|
||||
PARTICLES[i]->render(this);
|
||||
}
|
||||
@ -2100,6 +2114,7 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
CreateSprite("cursor.png");
|
||||
CreateSprite("targetCircle.png");
|
||||
CreateSprite("targetRange.png");
|
||||
CreateSprite("crosshair.png");
|
||||
}
|
||||
|
||||
void SetupObjectInfo() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user