Page 1 of 1
Camera module & Leif GUI
Posted: Wed Mar 11, 2009 9:57 pm
by Illidane
Hi everyone!
I'm using the camera module and leif gui in my project. I use my PC and netbook ( aspireone ) for it. On first it looks great ( resolution 1280, 1024; setCamera(camera.stretchToResolution(1280, 1024)) used ), on second ( 1024, 600; 800, 600; 640, 480 - any but 1280, 1024 ) gui ( and only gui ) looks terrible
Here is the PC and netbook screens:
Anybody knows where the problem?
Re: Camera module & Leif GUI
Posted: Wed Mar 11, 2009 10:37 pm
by Kaze
Re: Camera module & Leif GUI
Posted: Thu Mar 12, 2009 3:10 am
by osuf oboys
The source of the problem is that some of the drawing parameters do not operate on fractions of pixels which may cause problems when things are drawn as smaller than they originally were. For this application, the worst parts can be fixed by opening camera.lua and searching for "setScissor". change "camera.love.graphics.setScissor(x, y, w, h)" into "camera.love.graphics.setScissor(x, y, math.ceil(w), math.ceil(h))".
Re: Camera module & Leif GUI
Posted: Thu Mar 12, 2009 12:33 pm
by Illidane
osuf, it became better but not the same as on PC:
Re: Camera module & Leif GUI
Posted: Thu Mar 12, 2009 10:54 pm
by osuf oboys
What resolution does the game run in (e.g. what is width and height in game.conf)? Did I understand you correctly that you rescale to 1280x1024? Might I ask what the position of the "Sprites" window is?
Re: Camera module & Leif GUI
Posted: Fri Mar 13, 2009 1:15 am
by Kaze
Looks to me that x and y need to be ceil'd too.
Re: Camera module & Leif GUI
Posted: Fri Mar 13, 2009 5:30 am
by Illidane
osuf, game run in 1024 x 600, but I can set 800 x 600 and nothing changed. Space on the screen the same as PC, becouse I using setCamera(camera.stretchToResolution(1280, 1024)).
"Sprites" pos is -630, -502 ( 0,0 - is the center of the screen )
Kaze, I tried, it became just different, but not better.
Re: Camera module & Leif GUI
Posted: Fri Mar 13, 2009 12:10 pm
by Kaze