guiStaticImageLoadImage | Multi Theft Auto: Wiki Skip to content

guiStaticImageLoadImage

Client-side
Server-side
Shared

This function allows you to change the image in GUI static image element to another one.

Tip

If you set other images as children you will have to use setElementCallPropagationEnabled to only affect the parent image.

OOP Syntax Help! I don't understand this!

Syntax

bool guiStaticImageLoadImage ( ​gui-staticimage theElement, ​string filename )
Required arguments
  • theElement: The static image element to be changed.
  • filename: A string specifying the filepath of the image file being loaded in current resource.

Returns

Returns true if the the image in the static image element was successfully changed, false otherwise.

  • bool: result

Code Examples

client

This example creates a static image myimage.png and replaces it with other image otherimage.png 10 seconds after creation.

local myImage = guiCreateStaticImage(0.45, 0.48, 0.2, 0.5, "myimage.png", true)
setTimer(guiStaticImageLoadImage, 10000, 1, myImage, "otherimage.png")

See Also

GUI Functions