Page 3 of 3

Re: Brady- A Camera Library with Parallax Scrolling

Posted: Sat Oct 17, 2015 11:12 am
by Fantos
Okay, I played around the options, but nothing work. Sorry for my dumbness, and sorry for still asking for your help, here is what I made with gamera and that what I try to achive.

Re: Brady- A Camera Library with Parallax Scrolling

Posted: Sun Oct 18, 2015 1:03 am
by davisdude
No, you're not at fault- the docs are pretty poorly explained as they are right now.

For instance, the function camera.new takes 4 arguments: x, y, width, and height.
All these refer to the screen, i.e. x and y are the x and y position for the location of the camera on the screen. Width and height represent the camera's width and height on a default canvas.

In order to do what you want, it would look more like this:

Code: Select all

cam = camera.new( 0, 0, love.graphics.getDimensions() )
cam:setZoom( 4.8 )

Re: Brady- A Camera Library with Parallax Scrolling

Posted: Sun Oct 18, 2015 10:31 am
by Fantos
Alright, thank you for help and patience. Turn out when I move the camera with cam:moveTo the camera just ignore adjustposition and go through the boundaries. Have a nice day.

Re: Brady- A Camera Library with Parallax Scrolling

Posted: Sun Oct 18, 2015 1:40 pm
by davisdude
The camera shouldn't be ignoring those positions. It sounds like you haven't ported over the code correctly from gamera. I'm not really familiar with it, but I'm fairly sure you could get it to work like you have it with gamera.

Re: Brady- A Camera Library with Parallax Scrolling and Aspect Ratios

Posted: Mon Dec 19, 2016 10:24 pm
by davisdude
Brady has been updated. You can find the repo here.

Major points include:

- Compatible with 0.10.0
- Aspect ratios
- Relative scale for layers (on top of the layer scale)

Re: Brady- A Camera Library with Parallax Scrolling

Posted: Thu Mar 02, 2017 8:40 pm
by davisdude
Brady has been updated. You can find the repo here.

Updates include:

- Get the coordinates of the mouse within the world more easily with :getMouseWorldCoordinates
- Zoom into a given point (by a factor) with :scaleToPoint
- Zoom into a given point (by increment) with :incrementScaleToPoint