Brady- A Camera Library with Parallax Scrolling

Showcase your libraries, tools and other projects that help your fellow love users.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

Hi,

Could you upload the .love? Everything looks fine on a quick cursory search, but I have some questions/notes:
- All the functions where you give the camera an x and y position (except :setWorld), those x and y positions are for the center of the camera.
- When is the function love.draw/UpdateScene called?
- What are the values of campos?
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Fantos
Prole
Posts: 11
Joined: Sat Aug 08, 2015 9:22 am

Re: Brady- A Camera Library with Parallax Scrolling

Post by Fantos »

Of course, here it is, and thank you for your help. There are blocks between the rooms and in the platform.lua I get in these coordinations in the campos table.
Attachments
MV platformer.love
(1.22 MiB) Downloaded 152 times
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

Hey- I think the error might be related to STI- try updating to the newest version.
The newest version of STI requires you change your map type. I'm fairly certain this is the source of the error. If it still occurs upon updating, let me know.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Fantos
Prole
Posts: 11
Joined: Sat Aug 08, 2015 9:22 am

Re: Brady- A Camera Library with Parallax Scrolling

Post by Fantos »

I updated (STI and Tiled too) but the problem still occur. I'm not sure what you meant by "map type" but I tried every layer format and nothing changed.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

Could you upload the newest .love?
Thanks
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Fantos
Prole
Posts: 11
Joined: Sat Aug 08, 2015 9:22 am

Re: Brady- A Camera Library with Parallax Scrolling

Post by Fantos »

Nothing changed really beside sti and the map file, but here it is.
Attachments
MV platformer.love
(1.22 MiB) Downloaded 120 times
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

Hey, I can't seem to figure out what the problem is. Sorry.
Give me some time to look over it some more.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

Alright, I figured out the problem:
STI is using canvases to draw the map. This is good for speed, but not so good for the camera. If you comment out lines 760 and 774 of STI/map.lua, it will work.

*edit: Added a basic working example
Attachments
BWE.love
(35.54 KiB) Downloaded 133 times
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Fantos
Prole
Posts: 11
Joined: Sat Aug 08, 2015 9:22 am

Re: Brady- A Camera Library with Parallax Scrolling

Post by Fantos »

Thank you for your help. Shouldn't cam:adjustscale put the camera's picture on the whole window? I wroted poorly and I'm so sorry for that but the problem was the blue rectangle from the first picture is not the whole picture on the screen
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

No, what you have is working how it should in terms of that. Check out the documentation for camera.new.

Also, :adjustScale keeps the scaling of the camera within the world boundaries.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest