WoW:API GetZoneText: Difference between revisions
Jump to navigation
Jump to search
(→Notes: Added reference to GetRealZoneText) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi|toc=0}} | ||
Returns the localized name of the zone the player is in. | Returns the localized name of the zone the player is in. | ||
zoneName = GetZoneText(); | zoneName = GetZoneText(); | ||
==Parameters== | == Parameters == | ||
===Returns=== | === Returns === | ||
* zoneName (string) - zone name (localized). | |||
== | === Result === | ||
Message box appears displaying your current zone. | |||
== Examples == | |||
local zoneName = GetZoneText(); | local zoneName = GetZoneText(); | ||
message(zoneName); | message(zoneName); | ||
== Notes == | |||
==Notes== | |||
The event '''ZONE_CHANGED_NEW_AREA''' is triggered when the text changes. See also the related functions [[API_GetSubZoneText|GetSubZoneText]] and [[API_GetMinimapZoneText|GetMinimapZoneText]]. | The event '''ZONE_CHANGED_NEW_AREA''' is triggered when the text changes. See also the related functions [[API_GetSubZoneText|GetSubZoneText]] and [[API_GetMinimapZoneText|GetMinimapZoneText]]. | ||
Additional note: Blizzard also registers the event '''ZONE_CHANGED_INDOORS'''. If you know what this event is used for, please edit this page. | 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 | : 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 [[API_GetRealZoneText|GetRealZoneText]] to find the name of the instance instead of the subzone you happen to be in. | See also the related function [[API_GetRealZoneText|GetRealZoneText]] to find the name of the instance instead of the subzone you happen to be in. |
Revision as of 03:39, 29 May 2020
← WoW API < GetZoneText
Returns the localized name of the zone the player is in.
zoneName = GetZoneText();
Parameters
Returns
- zoneName (string) - zone name (localized).
Result
Message box appears displaying your current zone.
Examples
local zoneName = GetZoneText(); message(zoneName);
Notes
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.