GuiStaticImageLoadImage: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (tweak tip)
m (Added OOP Method + Variable Information)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Client function}}
{{Client function}}
__NOTOC__
__NOTOC__
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.
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.


==Syntax==  
==Syntax==  
Line 7: Line 7:
bool guiStaticImageLoadImage ( element theElement, string filename )
bool guiStaticImageLoadImage ( element theElement, string filename )
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[Element/GUI/Static_image|GuiStaticImage]]:loadImage|image}}
===Required Arguments===  
===Required Arguments===  
*'''theElement:''' The static image element to be changed.
*'''theElement:''' The static image element to be changed.

Latest revision as of 12:03, 7 August 2019

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.

Syntax

bool guiStaticImageLoadImage ( element theElement, string filename )

OOP Syntax Help! I don't understand this!

Method: GuiStaticImage:loadImage(...)
Variable: .image


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.

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

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