After that you can customise the toast's appearance by changing the values in lovelyToasts.style, or changing the toast's behaviour by changing lovelyToasts.options. Full documentation on this can be found on the GitHub page
Integrated and worked well enough. Unfortunately the X value (drawing from the left) is not quite right. It's always on the first third of the screen. I see you are doing a screenwidth/2 - textwidth/2, and this makes sense but it is not centred on my screen. I d/l a font (non-standard) so maybe something odd with that?
I guess this is the right time to ask for an X override as well as a Y override. I'd like the toast to appear above the avatar's head.
togFox wrote: ↑Thu May 20, 2021 9:24 am
Integrated and worked well enough. Unfortunately the X value (drawing from the left) is not quite right. It's always on the first third of the screen. I see you are doing a screenwidth/2 - textwidth/2, and this makes sense but it is not centred on my screen. I d/l a font (non-standard) so maybe something odd with that?
I guess this is the right time to ask for an X override as well as a Y override. I'd like the toast to appear above the avatar's head.
Hi! There is already a Y override the third argument in lovelyToasts.new is for the location, you can use the pre-defined positions "top", "middle", and "bottom", or you can provide your own Y value here.
As for the X value not being centered properly, would you mind showing me the code you use?
garrGameMessageLog is my array that stores all the messages (toast) I want to display. If a message is queued then I send it to lovelyToasts (which has it's own queue) then removes it from the message queue.
togFox wrote: ↑Thu May 20, 2021 10:32 am
garrGameMessageLog is my array that stores all the messages (toast) I want to display. If a message is queued then I send it to lovelyToasts (which has it's own queue) then removes it from the message queue.
The REQUIRE is at the top of the file (of course) so the width is 800 by default. Later on, in LOVE.LOAD() I do a setmode to 1920 but it's too late. LovelyToasts has already captured 800 and continues to use 800.
My hack (for now) is to move those two declarations above lovelyToasts, which is a bit ugly, because all my other declarations are grouped elsewhere:
-- ** needs to be placed above the lovelyToasts require
local gintScreenWidth = 1920
local gintScreenHeight = 1080
_ = love.window.setMode(gintScreenWidth, gintScreenHeight,{fullscreen=true,display=1,resizable=false}) -- display = monitor number (1 or 2)
lovelyToasts = require("lovelyToasts")
I guess LT should recheck screen width (and height) on each update but that seems very inefficient. Maybe a lovelyToasts.Initialise() on love.load to do that?
togFox wrote: ↑Thu May 20, 2021 11:11 am
The REQUIRE is at the top of the file (of course) so the width is 800 by default. Later on, in LOVE.LOAD() I do a setmode to 1920 but it's too late. LovelyToasts has already captured 800 and continues to use 800.
My hack (for now) is to move those two declarations above lovelyToasts, which is a bit ugly, because all my other declarations are grouped elsewhere:
-- ** needs to be placed above the lovelyToasts require
local gintScreenWidth = 1920
local gintScreenHeight = 1080
_ = love.window.setMode(gintScreenWidth, gintScreenHeight,{fullscreen=true,display=1,resizable=false}) -- display = monitor number (1 or 2)
lovelyToasts = require("lovelyToasts")
I guess LT should recheck screen width (and height) on each update but that seems very inefficient. Maybe a lovelyToasts.Initialise() on love.load to do that?
Hi! Thanks for reporting this, I fixed the issue in the library and uploaded it to GitHub as well as updated the script attached to the post