MichaelSinsbeck / platformer

A ninja platformer written in LÖVE
7 stars 0 forks source link

[LE] Camera #102

Closed Germanunkol closed 10 years ago

Germanunkol commented 10 years ago

I coded a small camera module: https://github.com/michalove/platformer/blob/master/editor/editorCam.lua I'm not good with all the coordinate-transformations, maybe you could look through it?

We definately need panning (i.e. sideway movement), and I have some zooming implemented as well, but I'm not sure if the latter is needed. What do you think? If we allow for zooming, I think it should be only one, maximum two levels of zooming out. The maximum for zooming in should be the normal size of the images, otherwise there's too many artifacts.

michalove commented 10 years ago

I used zooming a lot when I used the Tiled-Leveleditor. So I think it is a helpful feature. But it is probably enough to have the zoomlevels 2x and 4x.

I will have a look at the module.

michalove commented 10 years ago

I would like to add the following functionality:

Germanunkol commented 10 years ago

I agree. Right now I use the middle mouse buttons, but I don't really care which one it is. The zooming out is the thing I'm always confused about (I've done it multiple times, but its always such a long trial and error phase, which is why I wanted you to do it :P ). I'd really like if it stayed at the mouse position, yes. Maybe you can write/fix the screenToWorld function as well? Right now the tile placing has an offset when zoomed out.

I'm leaving now, so I won't be able to change anything else today. So if you have the time, feel free to mess with the code, there won't be any collisions with changes I make.

michalove commented 10 years ago

Done. Now I sticked to the middle mouse button, because you had implemented it like that. We can talk about the button-assignment later. If we need the buttons for erasing then middle button is cool for panning, otherwise, right button is a bit easier to press.

Germanunkol commented 10 years ago

I'll close the issue - button assignment can easily be changed later.

I'd like the right button to switch to the eraser, somehow. I keep on automatically trying it when wanting to erase - I don't quite know why I'm used to it so much. But it doesn't really matter... and the camera functionality is done.