GuiStaticImageLoadImage: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
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. | This function allows you to change the image in GUI static image element to another one. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool guiStaticImageLoadImage ( element theElement, string filename ) | bool guiStaticImageLoadImage ( element theElement, string filename ) | ||
Line 11: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theElement:''' The static image element to be changed. | *'''theElement:''' The static image element to be changed. | ||
*'''filename:''' A string specifying the location of the image file being loaded in current resource. The file must be predefined in resource's meta.xml file (see example). | *'''filename:''' A string specifying the location of the image file being loaded in current resource. The file must be predefined in resource's meta.xml file (see example). | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the the image in the static image element was successfully changed, ''false'' otherwise. | Returns ''true'' if the the image in the static image element was successfully changed, ''false'' otherwise. | ||
Line 31: | Line 27: | ||
<section name="meta.xml" class="server" show="true"> | <section name="meta.xml" class="server" show="true"> | ||
In this example meta.xml is used to tell the server which files it will be using. | In this example meta.xml is used to tell the server which files it will be using. | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="xml"> | ||
<info author="Yourname" version="1.0" /> | |||
<script src="example.lua" type="client" /> | |||
<file src="myimage.png" /> | |||
<file src="otherimage.png" /> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Revision as of 19:07, 18 May 2009
This function allows you to change the image in GUI static image element to another one.
Syntax
bool guiStaticImageLoadImage ( element theElement, string filename )
Required Arguments
- theElement: The static image element to be changed.
- filename: A string specifying the location of the image file being loaded in current resource. The file must be predefined in resource's meta.xml file (see example).
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.xmlIn this example meta.xml is used to tell the server which files it will be using.
<info author="Yourname" version="1.0" /> <script src="example.lua" type="client" /> <file src="myimage.png" /> <file src="otherimage.png" />
See Also
General functions
- guiBringToFront
- getChatboxLayout
- getChatboxCharacterLimit
- guiCreateFont
- guiBlur
- guiFocus
- guiGetAlpha
- guiGetCursorType
- guiGetEnabled
- guiGetFont
- guiGetInputEnabled
- guiGetInputMode
- guiGetPosition
- guiGetProperties
- guiGetProperty
- guiGetScreenSize
- guiGetSize
- guiGetText
- guiGetVisible
- guiMoveToBack
- guiSetAlpha
- guiSetEnabled
- guiSetFont
- guiSetInputEnabled
- guiSetInputMode
- guiSetPosition
- guiSetProperty
- guiSetSize
- guiSetText
- guiSetVisible
- isChatBoxInputActive
- isConsoleActive
- isDebugViewActive
- isMainMenuActive
- isMTAWindowActive
- isTransferBoxActive
- setChatboxCharacterLimit
- setDebugViewActive
Browsers
Buttons
Checkboxes
Comboboxes
- guiCreateComboBox
- guiComboBoxAddItem
- guiComboBoxClear
- guiComboBoxGetItemCount
- guiComboBoxGetItemText
- guiComboBoxGetSelected
- guiComboBoxIsOpen
- guiComboBoxRemoveItem
- guiComboBoxSetItemText
- guiComboBoxSetOpen
- guiComboBoxSetSelected
Edit Boxes
- guiCreateEdit
- guiEditGetCaretIndex
- guiEditGetMaxLength
- guiEditIsMasked
- guiEditIsReadOnly
- guiEditSetCaretIndex
- guiEditSetMasked
- guiEditSetMaxLength
- guiEditSetReadOnly
Gridlists
- guiCreateGridList
- guiGridListAddColumn
- guiGridListAddRow
- guiGridListAutoSizeColumn
- guiGridListClear
- guiGridListGetColumnCount
- guiGridListGetColumnTitle
- guiGridListGetColumnWidth
- guiGridListGetHorizontalScrollPosition
- guiGridListGetItemColor
- guiGridListGetItemData
- guiGridListGetItemText
- guiGridListGetRowCount
- guiGridListGetSelectedCount
- guiGridListGetSelectedItem
- guiGridListGetSelectedItems
- guiGridListGetSelectionMode
- guiGridListIsSortingEnabled
- guiGridListGetVerticalScrollPosition
- guiGridListInsertRowAfter
- guiGridListRemoveColumn
- guiGridListRemoveRow
- guiGridListSetColumnTitle
- guiGridListSetColumnWidth
- guiGridListSetHorizontalScrollPosition
- guiGridListSetItemColor
- guiGridListSetItemData
- guiGridListSetItemText
- guiGridListSetScrollBars
- guiGridListSetSelectedItem
- guiGridListSetSelectionMode
- guiGridListSetSortingEnabled
- guiGridListSetVerticalScrollPosition
Memos
- guiCreateMemo
- guiMemoGetCaretIndex
- guiMemoGetVerticalScrollPosition
- guiMemoSetVerticalScrollPosition
- guiMemoIsReadOnly
- guiMemoSetCaretIndex
- guiMemoSetReadOnly
Progressbars
Radio Buttons
Scrollbars
Scrollpanes
- guiCreateScrollPane
- guiScrollPaneGetHorizontalScrollPosition
- guiScrollPaneGetVerticalScrollPosition
- guiScrollPaneSetHorizontalScrollPosition
- guiScrollPaneSetScrollBars
- guiScrollPaneSetVerticalScrollPosition
Static Images
Tab Panels
Tabs
Text Labels
- guiCreateLabel
- guiLabelGetColor
- guiLabelGetFontHeight
- guiLabelGetTextExtent
- guiLabelSetColor
- guiLabelSetHorizontalAlign
- guiLabelSetVerticalAlign