Report as inappropriate.
This is a demo for my camera class. It is based on my container class that allowes to display worlds on an actor (https://www.greenfoot.org/scenarios/26528). This way, you can have as many cameras as you want and even move them around in realtime!
What the camera actually does is drawing all the images of the actors in the world the camera looks at onto itself. Additionally, it follows the position of a given actor. Additionally it can zoom in and out.
This showcase scenario has a detailed source code with comments to explain how to use the cameras (it's really simple). Just download it and take a look at the code. If you want to use this in your scenario, all you have to do is copy the 'packages' folder from this scenario into yours.
You have two cameras showing the same world. Move player 1 with wasd and player 2 with the arrow keys! The camera for player 1 is zoomed in with the factor 2x.
You can even pause the scenario and drag the cameras around!
Thumbnail image source: https://motionarray-content.imgix.net/post-images/Split-Screen-Tutorial-Premiere-Pro.jpg?w=3200&h=1200&fit=crop
285 views / 4 in the last 7 days
This scenario is a member of: Reusable classes
Want to leave a comment? You must first log in.
No votes yet.