Hello just a quick one when making dialog windows is there an easy way to add an image to spruce up the dialog?
i see this being used but i dont know how to use it. i have a simple PNG image and ive pointed the file="" to it still i cant see it in game.
local Image = require "engine.ui.Image"
image = Image.new{file="lore/"..l.image, auto_width=true, auto_height=true}
Help adding image to dialog box
Moderator: Moderator
Re: Help adding image to dialog box
ok sorry figured it out if anyone interested its
--add this to the other locals at the top
local Image = require "engine.ui.Image"
--add this somewhere in init
self.image = Image.new{file="locationOfFile.png", auto_width=true, auto_height=true}
--add this to the bottom of the dialog file
function _M:innerDisplay(x, y, nb_keyframes)
if self.image then
self.image:display(x + self.iw - self.image.w, y + self.ih - self.image.h)
end
end
that seemed to work
--add this to the other locals at the top
local Image = require "engine.ui.Image"
--add this somewhere in init
self.image = Image.new{file="locationOfFile.png", auto_width=true, auto_height=true}
--add this to the bottom of the dialog file
function _M:innerDisplay(x, y, nb_keyframes)
if self.image then
self.image:display(x + self.iw - self.image.w, y + self.ih - self.image.h)
end
end
that seemed to work
