OpenXcom Forum

Modding => Work In Progress => Topic started by: pinpk on August 05, 2013, 06:29:13 am

Title: Text overlay on Battlescape map
Post by: pinpk 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.
Title: Re: Text overlay on Battlescape map
Post by: Warboy1982 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.
Title: Re: Text overlay on Battlescape map
Post by: pinpk 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.