Image: Difference between revisions

From Crumbled World Wiki
(Created page with "{{:ImageExampleCode}} ==Inheritance== Panel ==Constructor== {| class="wikitable" !|function !|description |- |Image(PanelSize size, string fileName) | |- |Image(PanelSize size, Text fileName) | |- |Image(PanelSize size, Texture texture) | |- |} ==Functions== {| class="wikitable" !|return !|function !|description |- |Texture |getTexture() |get texture. |- | |setTexture(Text ima...")
 
(No difference)

Latest revision as of 14:08, 5 July 2025

Example

--add an image to panel with fill and the images width and height need to of equal length. 
local image = panel:add(Image(PanelSize(Vec2(-1),Vec2(1)), "LoadingScreen\loadingScreen1"))
--set image uvcoord
image:setUvCoord(Vec2(0.25,0.25),Vec2(0.75,0.75))

Inheritance

Panel

Constructor

function description
Image(PanelSize size, string fileName)
Image(PanelSize size, Text fileName)
Image(PanelSize size, Texture texture)

Functions

return function description
Texture getTexture() get texture.
setTexture(Text imageName) Set texture.
setTexture(string imageName) Set texture.
setTexture(Texture image) Set texture.
setUvCoord(Vec2 minCoordinate, Vec2 maxCoordinate) Set uvCoord.
setColor(Vec3 color) Set image color, default Vec3(1).
setColor(Vec4 color) Set image color, default Vec4(1).
setImageScale(float scale) Set image scale between [0,1].
setShader(string shaderName) Set shader for rendering the image
setShader(Shader shader) Set shader for rendering the image