Camera module & Leif GUI

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Illidane
Prole
Posts: 12
Joined: Sat Nov 29, 2008 8:01 pm

Camera module & Leif GUI

Post 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:
Image

Image

Anybody knows where the problem? :(
User avatar
Kaze
Party member
Posts: 189
Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland

Re: Camera module & Leif GUI

Post by Kaze »

Use another camera for the GUI, with a scale of 1..
http://love2d.org/wiki/index.php?title= ... one_camera
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Camera module & Leif GUI

Post 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))".
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
Illidane
Prole
Posts: 12
Joined: Sat Nov 29, 2008 8:01 pm

Re: Camera module & Leif GUI

Post by Illidane »

osuf, it became better but not the same as on PC:
Image
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Camera module & Leif GUI

Post 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?
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
Kaze
Party member
Posts: 189
Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland

Re: Camera module & Leif GUI

Post by Kaze »

Looks to me that x and y need to be ceil'd too.
User avatar
Illidane
Prole
Posts: 12
Joined: Sat Nov 29, 2008 8:01 pm

Re: Camera module & Leif GUI

Post 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.
User avatar
Kaze
Party member
Posts: 189
Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland

Re: Camera module & Leif GUI

Post by Kaze »

Use another camera for the GUI, with a scale of 1.
http://love2d.org/wiki/index.php?title= ... one_camera
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests