aliens

Author Topic: Text overlay on Battlescape map  (Read 4544 times)

Offline pinpk

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Text overlay on Battlescape map
« on: August 05, 2013, 06:29:13 am »
I'm brand new to the OpenXcom codebase and am trying to make some simple changes that you can hopefully help me with. In particular I'm trying to overlay text on the Battlescape map. It seems the text is only partly drawn however. I'm thinking this is because the map is being drawn after the text and thus screwing with its display. I noticed in the State class that Surfaces are drawn in the order they're added, so presumably adding Surface2 after Surface1 means Surface2 is drawn over Surface1. But the map is the first thing added in the BattlescapeState constructor and I'm adding my Text object after that, so clearly it's not quite that simple. Can someone enlighten me as to the order of draws here? Thanks.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Text overlay on Battlescape map
« Reply #1 on: August 05, 2013, 06:50:35 am »
the order is defined in the Map::drawTerrain() function, you'd need to blit it to the surface after the rest of the drawing takes place.

Offline pinpk

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Text overlay on Battlescape map
« Reply #2 on: August 05, 2013, 10:49:52 am »
I see. My Text object is in BattlescapeState. Where in BattlescapeState would the Text need to be blit to the map? Is BattlescapeState::handleState() where the map is being drawn? I tried blitting after the call to _battleGame->handleState() but that didn't seem to help. Thanks.