push
push copied to clipboard
Letterbox color vs BorderColor vs Background Color
Hey Ulydev, thanks for the useful library!
One thing I noticed with https://github.com/tomlum/simpleScale library is the option to set the letterbox color.
With your library, setting the background (borderColor?) color sets the background color of the virtual screen as well as the letterbox.
This is strange because the letterbox color almost always should be black, and the background color of the actual window should be the "background color" of the game in question. While ideally a game wouldn't use the native background color vs images / sprites, sometimes it matters.
One simple fix is to add:
backgroundR, backgroundG, backgroundB = 0.33, 0.33, 0.33
local oc = {}
oc.r, oc.g, oc.b, oc.a = love.graphics.getColor()
love.graphics.setColor(backgroundR, backgroundG, backgroundB)
love.graphics.rectangle("fill", 0, 0, self._WWIDTH, self._WHEIGHT)
love.graphics.setColor(oc.r,oc.g,oc.b,oc.a)
Just before Push:start()
, which gives us a grey background color and black letterboxes.
Does adding a configurable option to add this make sense?
Hello @jakebesworth , thanks for opening an issue!
I have looked into this, and while your fix would work, it doesn't take into account the use case where the background color could be changed after calling push:finish()
. There could be the possibility of manually drawing the letterbox around the game screen using 4 rectangles, but after trying it out it didn't give good results (small gaps between the game screen and the letterbox). So I'd say your solution is the most efficient right now, and I'll keep it in mind for the next update.
Thanks!