- Documentation
- Client functions
- guiCreateStaticImage
Function
guiCreateStaticImage
Creates an image from a resource file (PNG, JPG). The file must be listed in meta.xml.
Syntax
gui-staticimage guiCreateStaticImage(float x, float y, float width, float height, string path, bool relative [, element parent = nil])Arguments
xfloat- X position.
yfloat- Y position.
widthfloat- Width.
heightfloat- Height.
pathstring- File path.
relativebool- Relative values.Optional in MTA:SA: bool relative = false
parentelement, optional = nil- Parent.
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
guiCreateStaticImage(float x, float y, float width, float height, string path, bool relative = false, gui-element parent = nil)Returns
The image or false.
Example
local logo = guiCreateStaticImage(20, 20, 256, 128, "img/logo.png", false)
<meta>
<script src="client.lua" type="client" />
<file src="img/logo.png" />
</meta>