Image
Usage​
Client/Index.lua
local svgImage = [[data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" height="200" width="200"><circle cx="100" cy="100" r="80" stroke="black" stroke-width="3" fill="red" /></svg>]]
local image = EGUI.Image(10, 10, 100, 100, svgImage)
Constructor Parameters​
Type | Name | Default |
---|---|---|
number | posX | |
number | posY | |
number | width | |
number | height | |
string | image | |
table | parent | nil |
Functions​
Inherited Element Functions
Returns | Name | Description |
---|---|---|
Base Element | SetVisible | Sets element visibility |
boolean | IsVisible | Returns if element is visible |
Base Element | SetAlpha | Sets element alpha |
number | GetAlpha | Returns element alpha |
Base Element | SetPosition | Sets element position |
number , number | GetPosition | Returns element position |
Base Element | SetSize | Sets element size |
number , number | GetSize | Returns element size |
Base Element | SetAlignment | Sets element alignment |
string | GetAlignment | Gets element alignment |
Subscribe | Subscribes to an event | |
Unsubscribe | Unsubscribes from a event |
Returns | Name | Description |
---|---|---|
Image | SetImage | Sets the image |
string | GetImage | Gets the image |
Image | SetFit | Sets how to fit the image |
Image Fit | GetFit | Gets the image fit |
SetImage​
Sets the image
Returns the
Image
(self)
local svgImage = [[data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" height="200" width="200"><circle cx="100" cy="100" r="80" stroke="black" stroke-width="3" fill="red" /></svg>]]
image:SetImage(svgImage)
Type | Parameter | Default Value | Description |
---|---|---|---|
string | image | The new image |
GetImage​
Gets the image
Returns a
string
local currentImage = image:GetImage()
SetFit​
Sets the image fit
Returns the
Image
(self)
image:SetFit(EGUI.Image.Fit.Cover)
Type | Parameter | Default Value | Description |
---|---|---|---|
Image Fit | fit | The new fit of the image |
GetFit​
Gets the image fit
Returns a string
Image Fit
local fit = image:GetFit(svgImage)