ToGridFromHex (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a built-in global function. No include statement is needed.


Usage

ResourceType, PlayerID ToGridFromHex(float i, float j)


Returned Values

No description available.

Parameters

i: No description available.
j: No description available.


Source code samples

Redundant occurences have been removed.

CityBannerManager.lua

UI/InGame/CityBannerManager.lua
0592
local gridPosX, gridPosY = ToGridFromHex( hexPos.x, hexPos.y );
0664
local gridPosX, gridPosY = ToGridFromHex( instance.Hex.x, instance.Hex.y );


InGame.lua

UI/InGame/InGame.lua
0969
local gridX, gridY = ToGridFromHex( i, j );


ResourceIconManager.lua

UI/InGame/ResourceIconManager.lua
0073
local gridX, gridY  = ToGridFromHex( hexPosX, hexPosY );


TutorialChecks.lua

Tutorial/TutorialChecks.lua
2414
local iX, iY = ToGridFromHex(i, j);
2704
local iX, iY = ToGridFromHex( HPosX, HPosY );


UnitFlagManager.lua

UI/InGame/UnitFlagManager.lua
1252
local gridVecX, gridVecY = ToGridFromHex( hexPos.x, hexPos.y );
1441
local pPlot = Map.GetPlot( ToGridFromHex( hexPos.x, hexPos.y ) );



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.