<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=Events.SerialEventHexHighlight_%28Civ5_API%29</id>
	<title>Events.SerialEventHexHighlight (Civ5 API) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=Events.SerialEventHexHighlight_%28Civ5_API%29"/>
	<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Events.SerialEventHexHighlight_(Civ5_API)&amp;action=history"/>
	<updated>2026-04-07T15:25:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Events.SerialEventHexHighlight_(Civ5_API)&amp;diff=10916&amp;oldid=prev</id>
		<title>DonQuich: Bot update</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Events.SerialEventHexHighlight_(Civ5_API)&amp;diff=10916&amp;oldid=prev"/>
		<updated>2012-09-19T18:48:39Z</updated>

		<summary type="html">&lt;p&gt;Bot update&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Civ5 API Beta Banner}}&lt;br /&gt;
&amp;#039;&amp;#039;This page is a part of the [[Lua and UI Reference (Civ5)]].&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TypeInfos5|Function.png|This function is a member of {{Type5|Events}}.&amp;lt;br/&amp;gt;&lt;br /&gt;
This is a static method, invoke it with a dot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This event is triggered every time a hex is highlighted by the UI. Can be invoked from the Lua side, which highlights a hex and is the common usage. If a highlight style is given, it can be cleared again by using {{Func5|Events|ClearHexHighlightStyle}} or [[Lua_Game_Objects/Events#ClearHexHighlights|ClearHexHighlights]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Usage=&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;void&amp;#039;&amp;#039;&amp;#039; Events.SerialEventHexHighlight&amp;lt;b&amp;gt;(&amp;lt;/b&amp;gt;{{Type5|Vector2}} hex, &amp;#039;&amp;#039;&amp;#039;bool&amp;#039;&amp;#039;&amp;#039; highlight, {{Type5|Vector4}} highlightColor, &amp;#039;&amp;#039;&amp;#039;string&amp;#039;&amp;#039;&amp;#039; highlightStyle&amp;lt;b&amp;gt;)&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Event Type&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:Regular event: you can subscribe to it through &amp;lt;code&amp;gt;Events.SerialEventHexHighlight.Add(&amp;#039;&amp;#039;&amp;lt;function handler&amp;gt;&amp;#039;&amp;#039;)&amp;lt;/code&amp;gt; or invoke it directly through &amp;lt;code&amp;gt;Events.SerialEventHexHighlight(&amp;#039;&amp;#039;&amp;lt;arguments list&amp;gt;&amp;#039;&amp;#039;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:{|&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|hex:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;Hex coordinates of the tile to highlight. Can be created by using the Vector2(iHexX, iHexY) constructor when including FLuaVector.lua (see example)&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|highlight:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;If true, highlight, if false, remove highlight&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|highlightColor:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;The color to highlight in. Can be created by using the Vector4(r, g, b, a) constructor when including FLuaVector.lua (see example). Only allows certain colors. Known colors to work: (1,0,0,1), (0,1,0,1), (0,0,1,1), (0,0,1,0.25), (1,1,0,1), (1,0,1,1), (0.5,0.5,0.5,1)&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|highlightStyle:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;Use a custom highlighting style, in which case highlightColor is irrelevant. Known highlighting styles are: &amp;quot;MovementRangeBorder&amp;quot;, &amp;quot;AMRBorder&amp;quot;, &amp;quot;FireRangeBorder&amp;quot;, &amp;quot;ValidFireTargetBorder&amp;quot;, &amp;quot;GroupBorder&amp;quot;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; class=&amp;quot;civ5-example&amp;quot;&amp;gt;&lt;br /&gt;
include( &amp;quot;FLuaVector&amp;quot; );&lt;br /&gt;
-- highlight a hex when it changes ownership&lt;br /&gt;
function onHexCultureChanged(iHexX, iHexY, iPlayerID, bUnknown)&lt;br /&gt;
Events.SerialEventHexHighlight(Vector2(iHexX, iHexY), true, Vector4(1, 0.5, 0, 1))&lt;br /&gt;
end&lt;br /&gt;
Events.SerialEventHexCultureChanged.Add(onHexCultureChanged)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Source code samples=&lt;br /&gt;
&amp;#039;&amp;#039;Redundant occurences have been removed.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|Bombardment.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/Bombardment.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0072}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( hexID, true, highlightColor, &amp;quot;FireRangeBorder&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeLine5|0073}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( hexID, true, redColor, &amp;quot;ValidFireTargetBorder&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|CityView.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/CityView/CityView.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|1824}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( ToHexFromGrid( Vector2( plot:GetX(), plot:GetY() ) ), false, Vector4( 0.0, 1.0, 0.0, 1 ) );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|1861}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( ToHexFromGrid( Vector2( aPurchasablePlots[i]:GetX(), aPurchasablePlots[i]:GetY() ) ), true, Vector4( 1.0, 0.0, 1.0, 1 ) );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|DebugMode.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/DebugMode.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0037}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( Vector2( g_iHexX, g_iHexY ), false, Vector4( 0.5, 0.5, 0.5, 1.0 ) );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0420}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( Vector2( g_iHexX, g_iHexY ), true, Vector4( 0.5, 0.5, 0.5, 1.0 ) );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|InGame.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/InGame.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0305}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( hexID, false, workerSuggestHighlightColor, genericUnitHexBorder );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0423}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( hexID, true, Vector4( 1.0, 1.0, 0.0, 1 ), genericUnitHexBorder );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0464}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( hexID, true, embarkColor, genericUnitHexBorder );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0490}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( hexID, true, upgradeColor, genericUnitHexBorder );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0558}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( hexID, true, turn2Color, &amp;quot;GroupBorder&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0595}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( hexID, true, turn1Color, pathBorderStyle );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|InGame.lua (G&amp;amp;K)}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/Expansion/UI/InGame/InGame.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0689}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( iHexID, true, vGiftTileImprovementColor, genericUnitHexBorder );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|WorldView.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/WorldView/WorldView.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0765}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( Vector2( i, j ), true, turn1Color, attackPathBorderStyle );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0767}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;Events.SerialEventHexHighlight( Vector2( i, j ), true, turn1Color, pathBorderStyle );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Civ5 API Footer}}&lt;br /&gt;
[[Category:Civ5 Methods and Functions|SerialEventHexHighlight]]&lt;/div&gt;</summary>
		<author><name>DonQuich</name></author>
	</entry>
</feed>