Difference between revisions of "Global Command: setWindowTitle"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed tbl-ds"> <span class="bold">Function History</span> <div class="mw-collapsible-content"> <div class="alt-bg">Available since...")
 
m
Line 34: Line 34:
 
Example 3: set window title based on current game language
 
Example 3: set window title based on current game language
 
<syntaxhighlight>
 
<syntaxhighlight>
local lang = game:getLink(VGameCurrentLanguage):getName()
+
local lang = game:getLink(VGameCurrentLanguage):getName() -- store current game language
  
 
if lang == "English" then
 
if lang == "English" then

Revision as of 21:30, 23 March 2014

Function History

Available since v4.0


Allows you to set a custom title in the game application title bar. (only applicable for window mode)


Syntax:

setWindowTitle("title")


Example 1: basic set window title method

setWindowTitle("my new game title")

Example 2: set window title based on current users system language

sysLang = getProperty("system_language") -- store current os language

-- let's set the window title based on os language
if sysLang == "English" then 
 setWindowTitle("my new title in english")
elseif sysLang == "German" then
 setWindowTitle("mein neue titel auf deutsch")
end

Example 3: set window title based on current game language

local lang = game:getLink(VGameCurrentLanguage):getName() -- store current game language

if lang == "English" then
 setWindowTitle("my new title in english")
elseif lang == "German" then
 setWindowTitle("mein neue titel auf deutsch")
end


Arguments

title: "string"
This should include the text you want to be displayed in the application title bar (window mode)


Flags

none


Return

none