rgrams / rendercam

A universal render script & camera package for all the common camera types. (for Defold)
The Unlicense
98 stars 18 forks source link

Camera focus zone and viewport limit bounds #9

Open selimanac opened 6 years ago

selimanac commented 6 years ago

Hello @rgrams

As I said on Defold forums, I love rendercam. Thank you again. I added experimental features to rendercam for my game.

I'm not sure if these updates are the most efficient (performance-wise) way or not. i'll be glad if you can check them out. Since I'm using only one ortho cam, I didn't test it with multiple ortho/perspective cams.

If you want me to do some updates, please feel free to contact with me. I'm not a talented dev like you, but I can try my best. Maybe we can merge it, if you find them useful.

Here is my branch

rgrams commented 6 years ago

Whoa, very cool! I actually considered making these features in the beginning (Defold Orthographic has them), but I wasn't too interested in them for my own use, so I didn't bother. But this is great! I'll need some time to go over it thoroughly, but it looks pretty good. I'm impressed you managed to decipher my code.

"I'm not a talented dev like you"

Hah! Pff, nonsense. I'm an idiot with no idea what he's doing just like everyone else. :) I fought with camera stuff over and over again for almost a full year before making Rendercam.

selimanac commented 6 years ago

I know Defold Orthographic. It is a good cam too. Those features and of course the code that I use are similar with Defold Orthographic. Also with other stuff from forum. This is the way of learning and open source. I prefer rendercam and made those extensions for my personal use.

I made some changes just a couple a minutes ago. I removed unnecessary message posting stuff from event.

Thanks again

rgrams commented 6 years ago

Hey Selim, can you make a pull request with your stuff to my "dev" branch?

rgrams commented 6 years ago

Just a little update on this for anyone checking. I am very slowly working on a Version 2.0 which will include these features. They work fine for 2D orthographic cameras right now (functions renamed to set_bounds and set_follow_deadzone), if you want to use them, change your dependency link to this:

https://github.com/rgrams/rendercam/archive/2.0Beta.zip

Before I consider this release-worthy, it will need:

I think the follow deadzone is okay, but . . .

set_bounds definitely needs some work:

selimanac commented 6 years ago

I'm using dev branch with deadzone(orthographic) everyday. But still developing my game's base logics. So these are not my main focus for now. But they will and I'm going to use them heavily for lots of different situations. I will definitely report problems or my solutions.

rgrams commented 6 years ago

Cool. Yeah, I am just writing down a to-do list for myself mostly. If you, or anyone else wants to contribute to this, great(!), if not, I will get to it at some point. I have my own games to work on as well. I just want to keep this stuff in a dev/beta branch until it's more fool-proof.