MCPcopy Create free account
hub / github.com/EasyRPG/Player / GetScreenX

Method GetScreenX

src/game_character.cpp:72–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72int Game_Character::GetScreenX() const {
73 int x = GetSpriteX() / TILE_SIZE - Game_Map::GetDisplayX() / TILE_SIZE + TILE_SIZE;
74
75 if (Game_Map::LoopHorizontal()) {
76 x = Utils::PositiveModulo(x, Game_Map::GetTilesX() * TILE_SIZE);
77 }
78 x -= TILE_SIZE / 2;
79
80 return x;
81}
82
83int Game_Character::GetScreenY(bool apply_jump) const {
84 int y = GetSpriteY() / TILE_SIZE - Game_Map::GetDisplayY() / TILE_SIZE + TILE_SIZE;

Callers 5

EventMethod · 0.80
DrawSingleMethod · 0.80
DrawMethod · 0.80
DrawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected