-
Notifications
You must be signed in to change notification settings - Fork 73
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
Rotate viewport #109
Comments
Will you provice and example of using a rotated viewport? Maybe a minimap which centers on you? |
Do you have a special usecase in mind? Code-wise it probably shouldn't be much work due to the flexibility of the canvas. It would be like 1 line to add here: https://github.com/ippa/jaws/blob/master/src/viewport.js#L152 I would suggest adding it to your local jaws.js for the time being to get a feel for if we really want it there.. you could of course do your context.rotate before whatever canva draw-call in your game code too.. Also I'm a bit busy with clientwork for 2-3 weeks now. |
I think it would be good in many situations such as if you had a racing game that you wanted to view to rotate to face whichever way the car is going, a space game like they need to be fed -> http://gmc.yoyogames.com/index.php?showtopic=469713 (where the view would rotate with it the player) I think there's tons of really cool things you could do with it. |
mm.. good examples. One thing with rotation is that you also need an anchorpoint. In jaws.Sprite you have setAnchor("center|top_left|bottom_center|etc..."). Thinking if something similar makes sense for the viewport or you usually want more exact control when rotating it. |
More control is always better but I would say that the default would be center. |
Looking more into this I think it might not be as straightforward as I first thought. If we put rotate in Viewport.apply basically everything will be rotated (of course not a HUD/opther thigns outside of viewport.apply()). I'm not sure this will lead to the desired behavior, rotating enemies, player, backgrounds around a single point...? I suggest you test some with a game you're developing to understand what we really want here. Right now I don't have the time to dive deep into this. I would suggest starting by implementing this.angle in Viewport just as Sprite does it.. (as suggested above). It might be what you want but I'm not sure. |
I'll have to look into it when I have time. |
I'm not sure how hard this would be but I think it would be awesome to be able to rotate view-ports.
The text was updated successfully, but these errors were encountered: