Definition
ShowGUIImage(string GUIName, string imageName)
Description
This function shows the image imageName that belongs to the GUI GUIName.
Parameters
GUIName
Specifies the GUI name. You can also use the name “this” for this parameter. In this case, the name “this” refers to the GUI to which the image imageName belongs.
imageName
Specifies the image name that belongs to the GUI GUIName.
Example 1
function OnTriggerEnter(otherActorName) HideGUIImage("gui_SampleGUI17_MainMenuAbout", "backgroundImg") end function OnTriggerStay(otherActorName) end function OnTriggerExit(otherActorName) ShowGUIImage("gui_SampleGUI17_MainMenuAbout", "backgroundImg") end
Assume that the above script is attached to a trigger named “trigger1”. Whenever the main character or a prefab instance that has dynamic physics is entered into this trigger, the image “backgroundImg” that belongs to GUI “gui_SampleGUI17_MainMenuAbout” will be hidden. Whenever the main character or a prefab instance that has dynamic physics exits this trigger, the image “backgroundImg” that belongs to GUI “gui_SampleGUI17_MainMenuAbout” will be displayed.
Example 2
--Name of script is ShowGUIImage2.lua function OnSelectMouseLButtonDown() ShowGUIImage("this", "BackgroundImg") end function OnSelectMouseRButtonDown() end function OnSelectMouseEnter() end
Assume that the above script named ShowGUIImage2.lua is attached to a button named “PlayGame” that belongs to the GUI “gui_1”. Also assume that GUI “gui_1” has an image named “BackgroundImg”. In this case, “this” string in the ShowGUIImage function refers to the name “gui_1”. Whenever the user left clicks the “PlayGame” button, the ShowGUIImage function will display the “BackgroundImg” image belonging to GUI “gui_1”.