WoW:API GetZoneText: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API GetZoneText to API GetZoneText without leaving a redirect)
 
(8 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<center>'''GetZoneText''' ''-Documentation by [[user:Meog|Meog]]-''</center>
{{wowapi|toc=0}}
Returns the localized name of the zone the player is in.


Returns the zone text
zoneName = GetZoneText();


GetZoneText();
== Parameters ==
=== Returns ===
* zoneName (string) - zone name (localized).


----
=== Result ===
;''Arguments''
Message box appears displaying your current zone.


:''none''
== Examples ==
local zoneName = GetZoneText();
message(zoneName);


----
== Notes ==
;''Returns''
The event '''ZONE_CHANGED_NEW_AREA''' is triggered when the text changes. See also the related functions [[API_GetSubZoneText|GetSubZoneText]] and [[API_GetMinimapZoneText|GetMinimapZoneText]].


:String zonetext
Additional note: Blizzard also registers the event '''ZONE_CHANGED_INDOORS'''. If you know what this event is used for, please edit this page.
:;zonetext : string, contains the zone name


----
: The event ZONE_CHANGED_INDOORS would most likely be used if you were creating a minimap modification to notify you that you have gone into a building to change the minimap texture and the text above it to indicate the building you are in -- Salanex
;''Example''
local zonetext = GetZoneText();


;''Result''
See also the related function [[API_GetRealZoneText|GetRealZoneText]] to find the name of the instance instead of the subzone you happen to be in.
"Elwynn Forrest"
 
----
;''Description''
 
: Returns the zone text, in which the player currently is. The event <tt>"ZONE_CHANGED_NEW_AREA"</tt> is triggered, when the text changes. See also the related functions [[API_GetSubZoneText|GetSubZoneText]] and [[API_GetMinimapZoneText|GetMinimapZoneText]].
 
<small>Additional note: Blizzard also registers the event <tt>"ZONE_CHANGED_INDOORS"</tt>, please edit the page, if you know, for what it is.</small>
----
{{Template:WoW API}}

Latest revision as of 04:46, 15 August 2023

WoW API < GetZoneText

Returns the localized name of the zone the player is in.

zoneName = GetZoneText();

Parameters[edit]

Returns[edit]

  • zoneName (string) - zone name (localized).

Result[edit]

Message box appears displaying your current zone.

Examples[edit]

local zoneName = GetZoneText();
message(zoneName);

Notes[edit]

The event ZONE_CHANGED_NEW_AREA is triggered when the text changes. See also the related functions GetSubZoneText and GetMinimapZoneText.

Additional note: Blizzard also registers the event ZONE_CHANGED_INDOORS. If you know what this event is used for, please edit this page.

The event ZONE_CHANGED_INDOORS would most likely be used if you were creating a minimap modification to notify you that you have gone into a building to change the minimap texture and the text above it to indicate the building you are in -- Salanex

See also the related function GetRealZoneText to find the name of the instance instead of the subzone you happen to be in.