ToHexFromGrid (Civ5 API)

From Civilization Modding Wiki
Jump to: navigation, 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

Vector2 ToHexFromGrid(Vector2 gridPos)


Returned Value

No description available.

Parameters

gridPos: No description available.


Source code samples

Redundant occurences have been removed.

ActionInfoPanel.lua

UI/InGame/WorldView/ActionInfoPanel.lua
0110
local hex = ToHexFromGrid( Vector2(pPlot:GetX(), pPlot:GetY() ) );


CityBannerManager.lua

UI/InGame/CityBannerManager.lua
1252
OnCityCreated( ToHexFromGrid( Vector2( city:GetX(), city:GetY() ) ), player:GetID(), city:GetID() );


CityStateDiploPopup.lua (G&K)

DLC/Expansion/UI/InGame/Popups/CityStateDiploPopup.lua
0614
local hex = ToHexFromGrid(Vector2(pPlot:GetX(), pPlot:GetY()));


CityView.lua

UI/InGame/CityView/CityView.lua
1729
local hexPos = ToHexFromGrid( Vector2( plot:GetX(), plot:GetY() ) );
1824
Events.SerialEventHexHighlight( ToHexFromGrid( Vector2( plot:GetX(), plot:GetY() ) ), false, Vector4( 0.0, 1.0, 0.0, 1 ) );
1861
Events.SerialEventHexHighlight( ToHexFromGrid( Vector2( aPurchasablePlots[i]:GetX(), aPurchasablePlots[i]:GetY() ) ), true, Vector4( 1.0, 0.0, 1.0, 1 ) );


InGame.lua

UI/InGame/InGame.lua
0304
local hexID = ToHexFromGrid( Vector2( v.plot:GetX(), v.plot:GetY() ) );
0313
local hexID = ToHexFromGrid( Vector2( v:GetX(), v:GetY() ) );
0422
local hexID = ToHexFromGrid( Vector2( unit:GetX(), unit:GetY() ) );
0463
local hexID = ToHexFromGrid( Vector2( evalPlotX, evalPlotY ) );
0489
local hexID = ToHexFromGrid( Vector2( adjacentPlot:GetX(), adjacentPlot:GetY() ) );
0555
local hexID = ToHexFromGrid( Vector2( plotX, plotY) );


InGame.lua (G&K)

DLC/Expansion/UI/InGame/InGame.lua
0688
local iHexID = ToHexFromGrid( Vector2( iPlotX, iPlotY) );


TutorialEngine.lua

Tutorial/TutorialEngine.lua
0471
local hex = ToHexFromGrid( Vector2(plot:GetX(), plot:GetY() ) );


UnitPanel.lua

UI/InGame/WorldView/UnitPanel.lua
0747
local hexPosition = ToHexFromGrid(unitPosition);



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.