Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera focus zone and viewport limit bounds #9

Open
selimanac opened this issue Jan 5, 2018 · 6 comments
Open

Camera focus zone and viewport limit bounds #9

selimanac opened this issue Jan 5, 2018 · 6 comments

Comments

@selimanac
Copy link

selimanac commented Jan 5, 2018

Hello @rgrams

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

  • Camera focus zone
    Rectangle zone. Similar to this, but much more simple

  • Camera limits
    Rectangle for limiting camera movements. Like tilemap or any rect.

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
Copy link
Owner

rgrams commented Jan 5, 2018

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
Copy link
Author

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
Copy link
Owner

rgrams commented Jan 12, 2018

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

@rgrams
Copy link
Owner

rgrams commented Feb 10, 2018

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 . . .

  • check it with all camera types
  • try to test for any edge cases

set_bounds definitely needs some work:

  • To work with 2D-oriented perspective cameras
  • To fail with decent error messages if it's not going to work
    • . . . if there's any way to tell if it's not working/shouldn't work . . .
  • To behave better when the bounds are smaller than the visible area
  • Needs to be based on world position instead of local?
    • test with the camera as a child of a game object, with some offset, etc.

@selimanac
Copy link
Author

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
Copy link
Owner

rgrams commented Feb 10, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants