Page 1 of 2

STALKER-X (Camera library)

Posted: Fri Nov 17, 2017 5:49 am
by adnzzzzZ
Hi. I've created a camera library for LÖVE. It provides basic functionalities that a camera should have and is inspired by hump.camera and FlxCamera. The goal is to provide enough functions that building something like in this video becomes as easy as possible:



STALKER-X on github

Re: STALKER-X (Camera library)

Posted: Fri Nov 17, 2017 3:55 pm
by yetneverdone
Awesome! Very good documentation also! With lots of features hooray! Thanks dude

Re: STALKER-X (Camera library)

Posted: Fri Nov 17, 2017 10:10 pm
by Tjakka5
Absolutely fantastic! It seems to address all the issues I had with Hump Camera, while still being very easy to use.
I'll be sure to upgrade to this system once I can get around doing so.

Re: STALKER-X (Camera library)

Posted: Sat Nov 18, 2017 11:10 am
by Fuzzlix
Nice work. Thank you for sharing.

looking into it and using luacheck in ZBS i found this:

Code: Select all

function Camera:attach(x, y, w, h)
    local x, y = 0, 0
    ...
I am not shure what you wanted to do. Probably remove parameters x and y ?

Re: STALKER-X (Camera library)

Posted: Sat Nov 18, 2017 12:04 pm
by adnzzzzZ
Yea, I meant to do something else. I fixed it.

Re: STALKER-X (Camera library)

Posted: Sat Nov 18, 2017 4:23 pm
by master both
Amazing camera! I will certainly use it for future proyects. But I have a question, is there a way to make the shaking not move the camera position when it finishes, like it does in the example gif?

Re: STALKER-X (Camera library)

Posted: Sat Nov 18, 2017 5:06 pm
by adnzzzzZ
I should add an option for that. But for now you can just make the camera follow a target. If the camera is following a position then after the shake is done it will still be following that position.

Re: STALKER-X (Camera library)

Posted: Sat Nov 18, 2017 5:25 pm
by master both
adnzzzzZ wrote: Sat Nov 18, 2017 5:06 pm I should add an option for that. But for now you can just make the camera follow a target. If the camera is following a position then after the shake is done it will still be following that position.
Oh right, I'm asking for some cases like cutscenes, where the player doens't have control over the player, but I guess I can make the camera folow a target during those.

Re: STALKER-X (Camera library)

Posted: Sat Nov 18, 2017 9:31 pm
by adnzzzzZ
Just make it follow the center of the screen (in world coordinates).

Re: STALKER-X (Camera library)

Posted: Sat Nov 18, 2017 11:27 pm
by yetneverdone
Is there a debug mode where we can see the rectangular target as shown in the gif?