GuiStaticImageLoadImage

From Multi Theft Auto: Wiki
Revision as of 12:15, 23 June 2018 by MrDadosz (talk | contribs)
Jump to navigation Jump to search

This function allows you to change the image in GUI static image element to another one. You have to use setElementCallPropagationEnabled if you want to change only parent image.

Syntax

bool guiStaticImageLoadImage ( element 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.

Example

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

Click to collapse [-]
Client-side script (example.lua)
[lua]
local myImage = guiCreateStaticImage ( 0.45, 0.48, 0.2, 0.5, "myimage.png", true )
setTimer ( guiStaticImageLoadImage, 10000, 1, myImage, "otherimage.png" )
Click to collapse [-]
meta.xml

In this example meta.xml is used to tell the server which files it will be using.

<meta>
<info author="Yourname" version="1.0" />
<script src="example.lua" type="client" />
<file src="myimage.png" />
<file src="otherimage.png" />
</meta>

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI