HaxeFlixel / HaxeFlixel/flixel
Consider separating concepts of screen from camera
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
Presently, FlxCamera represents both the position at which a world is being observed (FlxCamera.scroll x/y) and the rectangular screen on which the world is drawn. It might be worth considering splitting these up, having both a FlxScreen and FlxCamera.
The obvious drawback is that it adds a little more complexity, although in practice most of this complexity would be hidden.
Benefits would include:-
- Easily swap cameras while maintaining screen size and position, as cameras are simply attached to a screen.
- View the same camera from different screens.
- Camera position would actually be the camera position (more intuitive than having a "scroll" position
- Encourage better implementations of existing features such as shake and zoom, which currently manipulate the entire screen position and size, whereas it would be better to implement these in terms of the screens view of the world.
I think most stuff you already do with FlxG.camera(s) would stay the same. There would need to be some way of tracking the screens, though.
Additional considerations:-
- Screen would have to be responsible for actually using some properties of the camera, such as the cameras bounds, as the effect is dependent on the size of the screen.
- Attach multiple cameras to the same screen? Possibly useful for HUD layers?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing FlxCamera, its scroll x/y state, and the FlxG.camera(s) usage mentioned in the issue. Trace how camera size, position, bounds, shake, and zoom are currently handled, then establish an agreed design for FlxScreen/FlxCamera responsibilities and the behavior that would define completion.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100