Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Letterbox color vs BorderColor vs Background Color #16

Open
jakebesworth opened this issue May 2, 2018 · 1 comment
Open

Letterbox color vs BorderColor vs Background Color #16

jakebesworth opened this issue May 2, 2018 · 1 comment

Comments

@jakebesworth
Copy link

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?

@Ulydev
Copy link
Owner

Ulydev commented May 2, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants