Skip to main content

Image

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​

TypeNameDefault
numberposX
numberposY
numberwidth
numberheight
stringimage
tableparentnil

Functions​

Inherited Element Functions
ReturnsNameDescription
Base ElementSetVisibleSets element visibility
booleanIsVisibleReturns if element is visible
Base ElementSetAlphaSets element alpha
numberGetAlphaReturns element alpha
Base ElementSetPositionSets element position
number, numberGetPositionReturns element position
Base ElementSetSizeSets element size
number, numberGetSizeReturns element size
Base ElementSetAlignmentSets element alignment
stringGetAlignmentGets element alignment
SubscribeSubscribes to an event
UnsubscribeUnsubscribes from a event
ReturnsNameDescription
ImageSetImageSets the image
stringGetImageGets the image
ImageSetFitSets how to fit the image
Image FitGetFitGets 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)
TypeParameterDefault ValueDescription
stringimageThe new image

GetImage​

Gets the image

Returns a string

local currentImage = image:GetImage()

SetFit​

Sets the image fit

Image

Returns the Image (self)

image:SetFit(EGUI.Image.Fit.Cover)
TypeParameterDefault ValueDescription
Image FitfitThe new fit of the image

GetFit​

Gets the image fit

Returns a string Image Fit

local fit = image:GetFit(svgImage)