|
Game
Class header file: BWAPI/Game.h The abstract Game class is implemented by BWAPI and offers many methods for retrieving information about the current Broodwar game, including the set of players, units, map information, as well as information about the user, such as mouse position, screen position, and the current selection of units.
MethodsgetForcesstd::set< [Force]* >& getForces();Returns the set of all forces in the match. See also: Game::getForce getPlayersstd::set< [Player]* >& getPlayers();Returns the set of all players in the match. Note that this includes the Neutral player, which owns all the neutral units such as minerals, critters, etc. getAllUnitsstd::set< [Unit]* >& getAllUnits();Returns all the visible units. If Flag::CompleteMapInformation is enabled, the set of all units is returned, not just visible ones. Note that units inside refineries are not included in this set yet. See also: Player::getUnits, Game::getMinerals, Game::getGeysers, Game::getNeutralUnits, Game::getStaticMinerals, Game::getStaticGeysers, Game::getStaticNeutralUnits getMineralsstd::set< [Unit]* >& getMinerals();Returns the set of all accessible (visible) mineral patches. See also: Game::getGeysers, Game::getNeutralUnits, Game::getStaticMinerals, Game::getStaticGeysers, Game::getStaticNeutralUnits getGeysersstd::set< [Unit]* >& getGeysers();Returns the set of all accessible (visible) vespene geysers. See also: Game::getMinerals, Game::getNeutralUnits, Game::getStaticMinerals, Game::getStaticGeysers, Game::getStaticNeutralUnits getNeutralUnitsstd::set< [Unit]* >& getNeutralUnits();Returns the set of all accessible (visible) neutral units, including mineral fields, vespene geysers, critters, and possibly other units owned by the neutral player. See also: Game::getMinerals, Game::getGeysers, Game::getStaticMinerals, Game::getStaticGeysers, Game::getStaticNeutralUnits getStaticMineralsstd::set< [Unit]* >& getStaticMinerals();Returns the set of all mineral patches (including mined out and other inaccessible ones). See also: Game::getMinerals, Game::getGeysers, Game::getNeutralUnits, Game::getStaticGeysers, Game::getStaticNeutralUnits getStaticGeysersstd::set< [Unit]* >& getStaticGeysers();Returns the set of all vespene geysers (including mined out and other inaccessible ones). See also: Game::getMinerals, Game::getGeysers, Game::getNeutralUnits, Game::getStaticMinerals, Game::getStaticNeutralUnits getStaticNeutralUnitsstd::set< [Unit]* >& getStaticNeutralUnits();Returns the set of all neutral units (including mined out and other inaccessible ones). See also: Game::getMinerals, Game::getGeysers, Game::getNeutralUnits, Game::getStaticMinerals, Game::getStaticGeysers getBulletsstd::set< [Bullet]* >& getBullets();Returns the set of all accessible bullets. getNukeDotsstd::set< [Misc#Position Position] >& getNukeDots();Returns the set of all accessible nuke dots. getEventsstd::list< [Event] >& getEvents();Returns the list of events for the current frame. Events correspond to AIModule callbacks, so for example rather than implementing AIModule::onUnitCreate you could check the list of events every frame and look for Event::UnitCreate. getForce[Force]* getForce(int forceID);Returns the Force with the given ID, or NULL if no Force has the given ID. See also: Game::getForces getPlayer[Player]* getPlayer(int playerID);Returns the Player with the given ID, or NULL if no Player has the given ID. getUnit[Unit]* getUnit(int unitID);Returns the Unit with the given ID, or NULL if no Unit has the given ID. indexToUnit[Unit]* indexToUnit(int unitIndex);Given an index value between 0 and 1699, this function will return the Unit* currently associated with the index value in Starcraft's internal Unit table. Only available when the Complete Map Information flag is enabled. getRegion[Region]* getRegion(int regionID);Returns the Region with the given ID, or NULL if no Region has the given ID. getAllRegionsconst std::set<[Region]*> &getAllRegions() const;Returns a set containing all Regions on the map. getRegionAt[Region] *getRegionAt(int x, int y) const; [Region] *getRegionAt([Position] position) const;Returns the Region at a given pixel position. getGameType[GameType] getGameType();Returns the game type of the given match, or GameTypes::None if Starcraft is in a replay. getLatencyLatency::Enum getLatency();Returns the amount of latency the current game has. Note: This value may be incorrect. Use Game::getLatencyFrames to obtain an accurate value. getLatencyFramesint getLatencyFrames();Returns the maximum number of frames required for unit commands to be processed by the game. See also: Game::getLatencyTime, Game::getRemainingLatencyFrames, Game::getRemainingLatencyTime getLatencyTimeint getLatencyTime();Returns the maximum time in milliseconds required for unit commands to be processed by the game. See also: Game::getLatencyFrames, Game::getRemainingLatencyFrames, Game::getRemainingLatencyTime getRemainingLatencyFramesint getRemainingLatencyFrames();Returns the remaining number of frames before a unit command sent in the current frame can be processed. See also: Game::getLatencyTime, Game::getLatencyFrames, Game::getRemainingLatencyTime getRemainingLatencyTimeint getRemainingLatencyTime();Returns the remaining time in milliseconds before a unit command sent in the current frame can be processed. See also: Game::getLatencyTime, Game::getLatencyFrames, Game::getRemainingLatencyFrames elapsedTimeint elapsedTime() const;Returns the time in game seconds that the game has been running for. This is equivalent to the staredit trigger condition ELAPSED TIME. A game second is not the same as a real second. It is an approximation relative to normal game speed. See also: Game::getFrameCount getFrameCountint getFrameCount();Returns the number of logical frames since the match started. If the game is paused, Game::getFrameCount will not increase however AIModule::onFrame will still be called while paused. On Fastest game speed, one frame is equal to 42 milliseconds. See also: Game::getReplayFrameCount getReplayFrameCountint getReplayFrameCount();Returns the maximum number of frames for a replay. To get the replay progress as a percentage, you can use getFrameCount()*100/getReplayFrameCount(). See also: Game::getFrameCount getAPMdouble getAPM(bool includeSelects = false);Returns the bot's running APM. This function ignores all user actions and uses the same formula as APMAlert. getFPSint getFPS();Returns the number of frames per second that the game is running at, based on the number of frames that have passed in the last second. See also: Game::getAverageFPS getAverageFPSint getAverageFPS();Returns the average number of frames per second that the game is running at. See also: Game::getFPS getLastEventTimeint getLastEventTime() const;Returns the time in milliseconds that the loaded AI module spent processing its last event. This is used by the tournament module to identify how long the loaded module spent processing an event. Calling this in a callback will retrieve the time that the process has spent in the same callback of the AI module. For example: calling this in onUnitDestroy retrieves the time spent in the AI's onUnitDestroy. getRevisionint getRevision();Retrieves the revision number for the current BWAPI build. See also: Game::isDebug getInstanceNumberint getInstanceNumber();Retrieves the number for the current instance of Starcraft/BWAPI. Used to identify which instance an AI module belongs to. getMousePosition[Misc#Position Position] getMousePosition();Returns the position of the mouse on the screen. Returns Positions::Unknown if Flag::UserInput is disabled. getMouseStatebool getMouseState([Input#MouseButton MouseButton] button); bool getMouseState(int button);Returns true if the specified mouse button is pressed. Returns false if Flag::UserInput is disabled. getKeyStatebool getKeyState([Input#Key Key] key); bool getKeyState(int key);Returns true if the specified key is pressed. Returns false if Flag::UserInput is disabled. Unfortunately this does not read the raw keyboard input yet - when you hold down a key, the getKeyState function is true for a frame, then false for a few frames, and then alternates between true and false (as if you were holding down the key in a text box). Hopefully this will be fixed in a later version. getScreenPosition[Misc#Position Position] getScreenPosition();Returns the position of the top left corner of the screen on the map. Returns Positions::Unknown if Flag::UserInput is disabled. See also: Game::setScreenPosition setScreenPositionvoid setScreenPosition(int x, int y); void setScreenPosition([Misc#Position Position] p);Moves the screen to the given position on the map. The position specified where the top left corner of the screen will be. See also: Game::getScreenPosition pingMinimapvoid pingMinimap(int x, int y); void pingMinimap([Misc#Position Position] p);Pings the given position on the minimap. isFlagEnabledbool isFlagEnabled([Misc#Flag::Enum Flag::Enum] flag);Returns true if the given flag has been enabled. Note that flags can only be enabled at the beginning of a match, during the AIModule::onStart callback. See also: Game::enableFlag enableFlagvoid enableFlag([Misc#Flag::Enum Flag::Enum] flag);Enables the specified flag. Note that flags can only be enabled at the beginning of a match, during the AIModule::onStart callback, or during the AIModule::onFrame callback on the first frame (frame 0). See also: Game::isFlagEnabled setGUIvoid setGUI(bool enabled);Disables all drawing functions in BWAPI and uses Game::setFrameSkip, specifying the highest frame skip value possible. This prevents the game from leaving its main loop. The game only draws to the screen once it has broken out of its main loop. Note that the game will still leave the loop once every 2 seconds. This alternative approach produces better results than the old setGUI behaviour. Note: You must call Game::setLocalSpeed(0) to first increase the game speed to its limits in order to witness any results. What's the difference between this and setFrameSkip(999999)? When setGUI is set to false, it will disable all of BWAPI's drawing functionality. If you've made drawing calls then they will be ignored. It also ignores drawing-related code that is used internally in BWAPI's onFrame. See also: Game::setFrameSkip, Game::setLocalSpeed isLatComEnabledbool isLatComEnabled();Returns true if latency compensation is enabled. It is enabled by default. setLatComvoid setLatCom(bool isEnabled);Use to enable or disable latency compensation. It is enabled by default. setCommandOptimizationLevelvoid setCommandOptimizationLevel(int level = 2);Use to set the command optimization level. This feature reduces APM and the replay size by grouping units performing the same actions.
getUnitsOnTilestd::set< [Unit]* >& getUnitsOnTile(int tileX, int tileY);Returns the set of units that are on the given build tile. Only returns accessible units on accessible tiles. getUnitsInRectanglestd::set<[Unit]*>& getUnitsInRectangle(int left, int top, int right, int bottom) const; std::set<[Unit]*>& getUnitsInRectangle([Misc#Position Position] topLeft, [Misc#Position Position] bottomRight) const;Retrieves the set of all accessable units within a rectangle. See also: Game::getUnitsInRadius getUnitsInRadiusstd::set<[Unit]*>& getUnitsInRadius([Misc#Position Position] center, int radius) const;Retrieves the set of all accessable units within a given radius. See also: Unit::getUnitsInRectangle getLastError[Error] getLastError() const;Returns the last error that was set. If you try to order enemy units around, or morph bunkers into lurkers, BWAPI will set error codes, which can be retrieved using this function. See also: Game::setLastError setLastErrorbool setLastError([Error] e);Sets the last error for BWAPI. For the sake of minimizing code, it will return true when the error is Errors::None and false otherwise. See also: Game::getLastError mapWidthint mapWidth();Returns the width of the current map, in build tile units. To get the width of the current map in walk tile units, multiply by 4. To get the width of the current map in Position units, multiply by TILE_SIZE (which is 32). See also: Game::mapHeight mapHeightint mapHeight();Returns the height of the current map, in build tile units. To get the height of the current map in walk tile units, multiply by 4. To get the height of the current map in Position units, multiply by TILE_SIZE (which is 32). See also: Game::mapWidth mapFileNamestd::string mapFileName();Returns the file name of the current map. See also: Game::mapPathName, Game::mapName mapPathNamestd::string mapFileName();Returns the path name of the current map (path + file name). See also: Game::mapFileName, Game::mapName mapNamestd::string mapName();Returns the name/title of the current map. See also: Game::mapPathName, Game::mapFileName mapHashstd::string mapHash();Returns the sha1 hash of the map file in an alpha-numeric string. isWalkablebool isWalkable(int walkX, int walkY);Returns true if the specified walk tile is walkable. The values of x and y are in walk tile coordinates (different from build tile coordinates). Note that this just uses the static map data. You will also need to make sure no ground units are on the coresponding build tile to see if its currently walkable. To do this, see getUnitsOnTile. Keep in mind that a "walk tile" is a 8x8 pixel tile, and 16 walk tiles make up a build tile. See also: Game::isBuildable getGroundHeightint getGroundHeight(int tileX, int tileY); int getGroundHeight([Misc#TilePosition TilePosition] position);Returns the ground height of the given build tile. 0 = low 1 = low doodads 2 = high 3 = high doodads 4 = very high 5 = very high doodads For information about attacking a unit from a lower to higher ground, see the Chance to Hit Guide. isBuildablebool isBuildable(int tileX, int tileY, bool includeBuildings = false); bool isBuildable([Misc#TilePosition TilePosition] position, bool includeBuildings = false);Returns true if the specified build tile is buildable. Note that this just uses the static map data. You will also need to make sure no ground units on the tile to see if its currently buildable. To do this, see getUnitsOnTile. This function was updated later to include a boolean that includes all visible buildings. By default it is set to false to maintain the original function's behaviour. See also: Game::isWalkable, Game::canBuildHere isVisiblebool isVisible(int tileX, int tileY); bool isVisible([Misc#TilePosition TilePosition] position);Returns true if the specified build tile is visible. If the tile is concealed by fog of war, the function will return false. See also: Game::isExplored isExploredbool isExplored(int tileX, int tileY); bool isExplored([Misc#TilePosition TilePosition] position);Returns true if the specified build tile has been explored (i.e. was visible at some point in the match). See also: Game::isVisible hasCreepbool hasCreep(int tileX, int tileY); bool hasCreep([Misc#TilePosition TilePosition] position);Returns true if the specified build tile has zerg creep on it. If the tile is concealed by fog of war, the function will return false. See also: Game::hasPower hasPowerbool hasPower(int tileX, int tileY, UnitType unitType = UnitTypes::None) const; bool hasPower([Misc#TilePosition TilePosition], UnitType unitType = UnitTypes::None) const; bool hasPower(int tileX, int tileY, int tileWidth, int tileHeight, UnitType unitType = UnitTypes::None) const; bool hasPower([Misc#TilePosition TilePosition] position, int tileWidth, int tileHeight, UnitType unitType = UnitTypes::None) const;Returns true if the given build location is powered by a nearby friendly pylon. If the unitType is specified, it will include the unit's properties in the calculation, so if the type does not require a pylon, it will return true for anywhere. Using the constructors that only take a tile position and unit type, it will use the unit type's width and height for calculation. See also: Game::hasCreep, Game::hasPowerPrecise hasPowerPrecisebool hasPowerPrecise(int x, int y, UnitType unitType = UnitTypes::None ) const; bool hasPowerPrecise([Misc#Position Position] position, UnitType unitType = UnitTypes::None) const;Returns true if the given pixel coordinate is powered by a nearby friendly pylon. If the unitType is specified, it will include the unit's properties in the calculation, so if the type does not require a pylon, it will return true for anywhere. The power calculation does not consider the width and height of the unit, as it's not required. See also: Game::hasPower hasPathbool hasPath([Misc#Position Position] source, [Misc#Position Position] destination) const;Returns true if the source position is in the same body of land as the destination position, and false otherwise. In other words, it returns true if a unit at the source position is able to walk all the way to the destination position. This does not include buildings and units blocking the path. It only looks at static map data. See also: Unit::hasPath canBuildHerebool canBuildHere([Unit]* builder, [Misc#TilePosition TilePosition] position, [UnitType] type, bool checkExplored = false);Returns true if the given unit type can be built at the given build tile position. Note the tile position specifies the top left tile of the building. If builder is not NULL, the unit will be discarded when determining whether or not any ground units are blocking the build location. If checkExplored is specified, then canBuildHere will also verify that the area has been explored first. canMakebool canMake([Unit]* builder, [UnitType] type);Returns true if the AI player has enough resources, supply, tech, and required units in order to make the given unit type. If builder is not NULL, canMake will return true only if the builder unit can build the given unit type. See also: Game::canBuildHere canResearchbool canResearch([Unit]* unit, [TechType] type);Returns true if the AI player has enough resources required to research the given tech type. If unit is not NULL, canResearch will return true only if the given unit can research the given tech type. See also: Game::canUpgrade canUpgradebool canUpgrade([Unit]* unit, [UpgradeType] type);Returns true if the AI player has enough resources required to upgrade the given upgrade type. If unit is not NULL, canUpgrade will return true only if the given unit can upgrade the given upgrade type. See also: Game::canResearch getStartLocationsstd::set< [Misc#TilePosition TilePosition] >& getStartLocations();Returns the set of starting locations for the given map. To determine the starting location for the players in the current match, see Player::getStartLocation. printfvoid printf(const char *format, ...);Prints text on the screen. Text is not sent to other players in multiplayer games. See also: Game::sendText, Game::drawText sendTextvoid sendText(const char *format, ...); void sendTextEx(bool toAllies, const char *format, ...);Sends text to other players - as if it were entered in chat. In single player games and replays, this will just print the text on the screen. If the game is a single player match and not a replay, then this function can be used to execute cheat codes, i.e. Broodwar->sendText("show me the money"). See also: Game::printf, Game::drawText changeRacevoid changeRace([Race] race);Used to change the race while in a lobby. Note that there is no onLobbyEnter callback yet, so this function cannot be used at this time. isInGamebool isInGame();Returns true if Broodwar is in a match (single player match, replay, or multiplayer match). Returns false if the Broodwar is in a menu screen. isMultiplayerbool isMultiplayer();Returns true if Broodwar is in a multiplayer game. Returns false for single player games and replays. See also: Game::isBattleNet, Game::isReplay isBattleNetbool isBattleNet();Returns true if Broodwar is in an online game on BattleNet or similar server (like ICCup). See also: Game::isMultiPlayer, Game::isReplay isPausedbool isPaused();Returns true if Broodwar is paused. If the game is paused, Game::getFrameCount will not increase however AIModule::onFrame will still be called while paused. isReplaybool isReplay();Returns true if Broodwar is in a replay. See also: Game::isMultiPlayer, Game::isBattleNet isDebugbool isDebug();Returns true if the current build is DEBUG, and false if the current build is RELEASE. See also: Game::getRevision startGamevoid startGame();Used to start the game while in a lobby. Note that there is no onLobbyEnter callback yet, so this function cannot be used at this time. pauseGamevoid pauseGame();Pauses the game. If the game is paused, Game::getFrameCount will not increase however AIModule::onFrame will still be called while paused. See also: Game::resumeGame resumeGamevoid resumeGame();Resumes the game. See also: Game::pauseGame leaveGamevoid leaveGame();Leaves the current match and goes to the after-game stats screen. setMapbool setMap(const char *mapFileName);Changes the map file to the one specified. Changes will take effect when the game is restarted. Returns true if successful. If this function fails, it returns false and sets the last error to Errors::Invalid_Parameter or Errors::File_Not_Found. restartGamevoid restartGame();Restarts the match. Works the same way as if you restarted the match from the menu screen. Only available in single player mode. setAlliancebool setAlliance([Player] *player, bool allied = true, bool alliedVictory = true);Sets the BWAPI player's alliance with the specified player, whether they're allied and allied victory is set. The alliedVictory field is ignored if allied is set to false. See also: Game::setVision setVisionbool setVision([Player] *player, bool enabled = true);Sets the BWAPI player's vision with the specified player. Commonly used when setting another player to ally or enemy. Returns false if the function failed. See also: Game::setAlliance setReplayVisionbool setReplayVision([Player] *player, bool enabled = true);Sets the visibility of a player when watching a replay. Returns false if the function failed, specifically if it is not a replay. See also: Game::setVision setRevealAllbool setRevealAll(bool reveal = true);Toggles the fog of war when watching a replay. Returns false if the game is not a replay. setLocalSpeedvoid setLocalSpeed(int speed = -1);Sets the speed of the game to the given number. Lower numbers are faster. 0 is the fastest speed Starcraft can handle (which is about as fast as the fastest speed you can view a replay at). Any negative value will reset the speed to the starcraft default. See also: Game::setGUI, Game::setFrameSkip setFrameSkipvoid setFrameSkip(int frameSkip = 1);Alters Starcraft's built-in frame skipping. This value is normally only changed during replays on 16x speed. The default value is 1. See also: Game::setGUI, Game::setLocalSpeed issueCommandbool issueCommand(const std::set<[Unit]*>& units, [UnitCommand] command);Issues a command to a set of units. Returns true if at least one unit was able to execute the command. This will select the units specified in groups of 12 and order them all at once without wasting additional commands. getSelectedUnitsstd::set<[Unit]*>& getSelectedUnits();Returns the set of units currently selected by the user in the GUI. If Flag::UserInput was not enabled during the AIModule::onStart callback, this function will always return an empty set. self[Player]* self();Returns a pointer to the player that BWAPI controls. In replays this will return NULL. See also: Game::allies, Game::enemies, Game::enemy, Game::neutral enemy[Player]* enemy();Returns a pointer to the enemy player. If there is more than one enemy, use enemies() to get the set of all enemy players that have not left or been defeated. In replays this will return NULL. See also: Game::allies, Game::enemies, Game::neutral, Game::self neutral[Player]* neutral();Returns a pointer to the neutral player. See also: Game::allies, Game::enemies, Game::enemy, Game::self alliesstd::set<[Player]*>& allies();Returns a reference to the set of ally players that have not left or been defeated. See also: Game::enemies, Game::enemy, Game::neutral, Game::self enemiesstd::set<[Player]*>& enemies();Returns a reference to the set of enemy players that have not left or been defeated. See also: Game::allies, Game::enemy, Game::neutral, Game::self observersstd::set<[Player]*>& observers();Returns a reference to the set of observer players that have not left the game. See also: Game::allies, Game::enemies setTextSizevoid setTextSize(int size);Sets the size at which text using drawText will be drawn at. The values are as follows: 0 = Smallest 1 = Small (default) 2 = Large 3 = Largest See also: Game::drawText drawTextvoid drawText(CoordinateType::Enum ctype, int x, int y, const char *format, ...); void drawTextMap(int x, int y, const char *format, ...); void drawTextMouse(int x, int y, const char *format, ...); void drawTextScreen(int x, int y, const char *format, ...);Draws text on the screen at the given position. Text can be drawn in different colors by using the following control characters:
See also: Game::setTextSize, Game::sendText, Game::printf drawBoxvoid drawBox(CoordinateType::Enum ctype, int left, int top, int right, int bottom, Color color = Color(Colors::Green), bool isSolid = false); void drawBoxMap(int left, int top, int right, int bottom, Color color = Color(Colors::Green), bool isSolid = false); void drawBoxMouse(int left, int top, int right, int bottom, Color color = Color(Colors::Green), bool isSolid = false); void drawBoxScreen(int left, int top, int right, int bottom, Color color = Color(Colors::Green), bool isSolid = false);Draws a box on the screen, with the given color. If isSolid is true, the entire box will be rendered, otherwise just the outline will be drawn. See also: Game::drawTriangle, Game::drawLine, Game::drawDot, Game::drawEllipse, Game::drawCircle drawCirclevoid drawCircle(CoordinateType::Enum ctype, int x, int y, int radius, Color color = Color(Colors::Green), bool isSolid = false); void drawCircleMap(int x, int y, int radius, Color color = Color(Colors::Green), bool isSolid = false); void drawCircleMouse(int x, int y, int radius, Color color = Color(Colors::Green), bool isSolid = false); void drawCircleScreen(int x, int y, int radius, Color color = Color(Colors::Green), bool isSolid = false);Draws a circle on the screen, with the given color. If isSolid is true, a solid circle is drawn, otherwise just the outline of a circle will be drawn. See also: Game::drawTriangle, Game::drawLine, Game::drawDot, Game::drawEllipse, Game::drawBox drawEllipsevoid drawEllipse(CoordinateType::Enum ctype, int x, int y, int xrad, int yrad, Color color = Color(Colors::Green), bool isSolid = false); void drawEllipseMap(int x, int y, int xrad, int yrad, Color color = Color(Colors::Green), bool isSolid = false); void drawEllipseMouse(int x, int y, int xrad, int yrad, Color color = Color(Colors::Green), bool isSolid = false); void drawEllipseScreen(int x, int y, int xrad, int yrad, Color color = Color(Colors::Green), bool isSolid = false);Draws an ellipse on the screen, with the given color. If isSolid is true, a solid ellipse is drawn, otherwise just the outline of an ellipse will be drawn. See also: Game::drawTriangle, Game::drawLine, Game::drawDot, Game::drawCircle, Game::drawBox drawDotvoid drawDot(CoordinateType::Enum ctype, int x, int y, Color color = Color(Colors::Green)); void drawDotMap(int x, int y, Color color = Color(Colors::Green)); void drawDotMouse(int x, int y, Color color = Color(Colors::Green)); void drawDotScreen(int x, int y, Color color = Color(Colors::Green));Draws a dot on the screen at the given position with the given color. See also: Game::drawTriangle, Game::drawLine, Game::drawEllipse, Game::drawCircle, Game::drawBox drawLinevoid drawLine(CoordinateType::Enum ctype, int x1, int y1, int x2, int y2, Color color = Color(Colors::Green)); void drawLineMap(int x1, int y1, int x2, int y2, Color color = Color(Colors::Green)); void drawLineMouse(int x1, int y1, int x2, int y2, Color color = Color(Colors::Green)); void drawLineScreen(int x1, int y1, int x2, int y2, Color color = Color(Colors::Green));Draws a line on the screen from (x1,y1) to (x2,y2) with the given color. See also: Game::drawTriangle, Game::drawDot, Game::drawEllipse, Game::drawCircle, Game::drawBox drawTrianglevoid drawTriangle(CoordinateType::Enum ctype, int ax, int ay, int bx, int by, int cx, int cy, Color color = Color(Colors::Green), bool isSolid = false); void drawTriangleMap(int ax, int ay, int bx, int by, int cx, int cy, Color color = Color(Colors::Green), bool isSolid = false); void drawTriangleMouse(int ax, int ay, int bx, int by, int cx, int cy, Color color = Color(Colors::Green), bool isSolid = false); void drawTriangleScreen(int ax, int ay, int bx, int by, int cx, int cy, Color color = Color(Colors::Green), bool isSolid = false);Draws a triangle on the screen. If isSolid is true, a solid triangle is drawn, otherwise just the outline of the triangle will be drawn. See also: Game::drawLine, Game::drawDot, Game::drawEllipse, Game::drawCircle, Game::drawBox | |
Have in mind drawBoxMap paints info on the central game view (not the minimap), starting from the north-west corner. So to show something of scale you have to multiply by tile size - 32. drawBoxMap(0,0,10*32,10*32,bridge.White,true)