Hi there!
I am new to love2d, but a day of explorations proved that this engine is really cool. However, as I am Linux user (specifically Debian Wheezy with Openbox DE) I have experienced fullscreen issue (I guess you've heard of it, linux users, don't you?). It is obvious that the bug comes from SDL library love2d depends on (I have tried to write simple game engine and faced the same thing some time ago). However, there is certainly a way to overcome it.
1) I am interested how can I set fullscreen mode without changing screen resolution in conf.lua file
2) A good idea is to implement so-called viewport scaling, so that you can choose game resolution whatever is the best fit for your needs, but the screen resolution would remain native.
I am interested to hear you opinions and see how many there are linux users who develop with love2d.
Best regards,
RostakaGmfun
Fullscreen in Linux issue
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- RostakaGmfun
- Prole
- Posts: 3
- Joined: Fri Mar 06, 2015 12:40 pm
- Location: Kyiv, Ukraine
- Contact:
Re: Fullscreen in Linux issue
one way i learned how to make fullscreen scale properly and look fancy how you want it is with a function like this..
but for this to work with linux exactly who knows...you can try this out tho.
Code: Select all
function checkResolution()
if fullscreen == false then
love.graphics.setMode(0, 0, false, v, f)
love.graphics.setMode(love.graphics.getWidth() - 200,love.graphics.getHeight() - 200, false, v, f)
end
if fullscreen == true then
love.graphics.setMode(0, 0, true, v, f)
love.graphics.setMode(love.graphics.getWidth(),love.graphics.getHeight(), true, v, f)
end
end
Re: Fullscreen in Linux issue
I'm on i3 on Arch with no issues.RostakaGmfun wrote:Hi there!
I am new to love2d, but a day of explorations proved that this engine is really cool. However, as I am Linux user (specifically Debian Wheezy with Openbox DE) I have experienced fullscreen issue (I guess you've heard of it, linux users, don't you?). It is obvious that the bug comes from SDL library love2d depends on (I have tried to write simple game engine and faced the same thing some time ago). However, there is certainly a way to overcome it.
1) I am interested how can I set fullscreen mode without changing screen resolution in conf.lua file
2) A good idea is to implement so-called viewport scaling, so that you can choose game resolution whatever is the best fit for your needs, but the screen resolution would remain native.
I am interested to hear you opinions and see how many there are linux users who develop with love2d.
Best regards,
RostakaGmfun
For changing fullscreen mode at runtime, here's the API:
https://www.love2d.org/wiki/love.window
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Fullscreen in Linux issue
What kind of issue are you experiencing? exclusive-fullscreen mode has drawbacks but they shouldn't manifest as bugs.RostakaGmfun wrote:Hi there!
I am new to love2d, but a day of explorations proved that this engine is really cool. However, as I am Linux user (specifically Debian Wheezy with Openbox DE) I have experienced fullscreen issue (I guess you've heard of it, linux users, don't you?). It is obvious that the bug comes from SDL library love2d depends on (I have tried to write simple game engine and faced the same thing some time ago). However, there is certainly a way to overcome it.
RostakaGmfun wrote:1) I am interested how can I set fullscreen mode without changing screen resolution in conf.lua file
Code: Select all
function love.conf(t)
t.window.fullscreen = true
t.window.fullscreentype = "desktop"
end
Code: Select all
function love.load()
love.window.setMode(800, 600, {fullscreen = true, fullscreentype = "desktop"})
end
Code: Select all
function love.keypressed(key)
if key == "f" then
love.window.setFullscreen(not love.window.getFullscreen(), "desktop")
end
end
- RostakaGmfun
- Prole
- Posts: 3
- Joined: Fri Mar 06, 2015 12:40 pm
- Location: Kyiv, Ukraine
- Contact:
Re: Fullscreen in Linux issue
Hm, interesting. On my system, If I change the resolution of love game and move mouse to the edge of the screen, the view will scroll and you will see other windows under the game window. What is most annoying thins is that when I tried to take screenshot of this, I actually got game window and black background at places where desktop is visible:S0lll0s wrote: I'm on i3 on Arch with no issues.
For changing fullscreen mode at runtime, here's the API:
https://www.love2d.org/wiki/love.window
Update
Just came up with the idea that mouse can be fixed at the center of the window, and the desktop will never be visible, because mouse will never reach the edge of the screen. I will try in a moment and tell how that was went on.
- RostakaGmfun
- Prole
- Posts: 3
- Joined: Fri Mar 06, 2015 12:40 pm
- Location: Kyiv, Ukraine
- Contact:
Re: Fullscreen in Linux issue
At last, I made that.
Here is example code:
Briefly, it sets screen resolution from screen table. Next it processes mouse move event in love.mousemoved(). Every time mouse is moved it is being put back at the center of the screen, and mouse table is updated with position of mouse. In love.draw() the mouse coordinates are printed and an orange circle is drawn at position (mouse.x,mouse.y). This way, you still get your mouse and fullscreen in Linux working perfectly. Please tell me if it works on your systems.
Hope somebody will find this useful.
Update
The only thing left is to hide real mouse cursor and draw nice cursor image instead of orange circle. Also, mouse sensitivity should be tweaked a bit.
Here is example code:
Code: Select all
local screen = {}
screen.w = 800
screen.h = 600
local mouse = {}
mouse.x = screen.w/2
mouse.y = screen.h/2
function love.load()
love.window.setMode(screen.w/2,screen.h/2,{fullscreen=true})
love.graphics.setBackgroundColor(128,128,128)
love.graphics.setColor(255,192,28)
love.mouse.setX(0)
love.mouse.setX(0)
love.mouse.setY(screen.w/2)
love.mouse.setY(screen.h/2)
end
function love.mousemoved(x, y, dx, dy)
mouse.x = mouse.x+x-screen.w/2
mouse.y = mouse.y+y-screen.h/2
if mouse.x>screen.w
then mouse.x = screen.w
elseif mouse.x<0
then mouse.x = 0
end
if mouse.y>screen.h
then mouse.y = screen.h
elseif mouse.y<0
then mouse.y = 0
end
love.mouse.setX(screen.w/2)
love.mouse.setY(screen.h/2)
end
function love.draw()
love.graphics.print("mouse.x: "..mouse.x..",mouse.y: "..mouse.y, 10, 10)
love.graphics.circle("fill", mouse.x,mouse.y, 10, 20)
end
Hope somebody will find this useful.
Update
The only thing left is to hide real mouse cursor and draw nice cursor image instead of orange circle. Also, mouse sensitivity should be tweaked a bit.
Who is online
Users browsing this forum: Bing [Bot] and 7 guests