ScaleGUIImage

Definition

ScaleGUIImage(string GUIName, string imageName, double scaleValue)

Description

This function sets the scale of the image imageName that belongs to the GUI GUIName.  In this case, the length and width of the image imageName are multiplied by the scaleValue. A value of 1.0 for scaleValue will be equivalent to the initial size of the image.

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.

scaleValue
Specifies the scale of the image imageName that belongs to the GUI GUIName. This value must be equal to or greater than 1.0.

Example 1

function OnTriggerEnter(otherActorName)
    ScaleGUIImage("gui_SampleGUI17_MainMenuAbout""backgroundImg", 1.5)
end

function OnTriggerStay(otherActorName)

end

function OnTriggerExit(otherActorName)

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, ScaleGUIImage function sets the scale of the image “backgroundImg” that belongs to GUI “gui_SampleGUI17_MainMenuAbout” to 1.5. In this case, the length and width of the image “backgroundImg” are multiplied by 1.5.

Example 2

--Name of script is ScaleGUIImage2.lua

function OnSelectMouseLButtonDown()
    ScaleGUIImage("this""BackgroundImg", 2.0)
end

function OnSelectMouseRButtonDown()

end

function OnSelectMouseEnter()

end
Assume that the above script named ScaleGUIImage2.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 ScaleGUIImage function refers to the name “gui_1”. Whenever the user left clicks the “PlayGame” button, the ScaleGUIImage function doubles the size of the “BackgroundImg” image belonging to GUI “gui_1”.
adminScaleGUIImage