Camera for a 2D project

Here’s some code, it probably won’t be of any help.
It’s a bit hacky, and probably a terrible way to handle this :smiley:
This thread caught my eye because I’m also interested in potentially moving to using the Camera class instead.


STLayerPanZoom (modified version of CCLayerPanZoom)
Low-Level “camera” manipulation and input handling.

https://gist.github.com/stevetranby/6813fbb427fb57a0cc2ed268b8d15ac0 .

I believe this came from this discussion, but otherwise from another repo/source. modified from an original source repo, possibly ObjC that I ported)
CCLayerPanZoom for cocos2dx .


CameraManager (managers are dumb, but it is what it is :D)
Mainly enhances w/somewhat “higher level” API

https://gist.github.com/stevetranby/32bf3f27b389e5497750b33edeb8c8cc .


Use Case
https://gist.github.com/stevetranby/3d69781cdc3306493a880d936928190e .

1 Like