sprites now draw centered

main
JanEhehalt 3 years ago
parent 796b86cd1a
commit a2033b94ef

@ -18,6 +18,4 @@ Fantasy Welt oder Realistisch?
+ LinkedList erweitern + LinkedList erweitern
+ Sprites Animationen etc improven + Sprites Animationen etc improven
### WiP ### WiP
+ Sprite Auswahlrechteck in inputHandler umschreiben auf World Koordinaten. Sprites an sich sind auf World Koordinaten geändert

BIN
spiel

Binary file not shown.

@ -27,11 +27,11 @@ void DrawSpriteToWorld(Sprite *sprite, IsometricMap *map, Camera2D *camera){
pos.x -= camera->target.x; pos.x -= camera->target.x;
pos.y -= camera->target.y; pos.y -= camera->target.y;
if(sprite->selected){ if(sprite->selected){
DrawTexture(*sprite->texture, pos.x, pos.y, WHITE); DrawTexture(*sprite->texture, pos.x - sprite->texture->width/4, pos.y - sprite->texture->height/4, BLACK);
//DrawTexture(*sprite->texture, sprite->x, sprite->y, BLACK); //DrawTexture(*sprite->texture, sprite->x, sprite->y, BLACK);
} }
else{ else{
DrawTexture(*sprite->texture, pos.x, pos.y, WHITE); DrawTexture(*sprite->texture, pos.x - sprite->texture->width/4, pos.y - sprite->texture->height/4, WHITE);
} }
} }

Binary file not shown.
Loading…
Cancel
Save