Zooming and Rotating camera

letmethink

  • *
  • Posts: 2545
Today I had fun making some sort of zooming and basic rotation for my camera in my game. The rotation can definitely be improved a lot, but for now I'll leave it as a proof of concept.

Use z to zoom in and x to zoom out
Arrows to move
W and S to rotate the camera (still very very temporary)
A to reset the rotation

(Also click to begin)

<a href="http://lmtproductions.weebly.com/uploads/2/0/7/9/20793336/fun.swf" target="_blank" class="new_win">http://lmtproductions.weebly.com/uploads/2/0/7/9/20793336/fun.swf</a>

Hopefully I can actually utilize this in the future. (I was thinking of a pinch to zoom in a mobile game, but also of dynamic zooming in a 'beat 'em up')
~Letmethink

mdotedot

  • Posts: 1654
One word: awesome
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

yoplalala

  • *
  • Posts: 1632
Nice ! You did this with the image api ?

Natrium

  • *
  • Posts: 111
Looks nice!

If you made it with the image API, wouldn't it slow down the game if the screen is to large? Also, can you zoom out (less than 100%), so you see more from the level

letmethink

  • *
  • Posts: 2545
I have tested it quite a bit and am not seeing much slowdown. Currently I only know how to actively see the area of the screen that would be displayed so I can't zoom out to see more of the screen (although I may try forcing changing the screen size mid-game and seeing the effects).

I did do it with the image API.
~Letmethink

laserhosen

  • *
  • Posts: 21
This is great! Any chance of sharing this in the future?

letmethink

  • *
  • Posts: 2545
When I wrap it nicely I probably will. Currently it is quite a mess of code.

« Last Edit: September 06, 2015, 01:04:14 am by letmethink »
~Letmethink

Donni11

  • *
  • Posts: 2181
Wow super cool :) !  Any chance of turning this into a extension ?
Peace

airman4

  • Posts: 875
woahhhh !!!
hope you can do a zone , a region and it zoom out to show the scenery

« Last Edit: September 08, 2015, 09:29:27 am by airman4 »

havana24

  • *
  • Posts: 508
This is what I'm searching for!
If you could make an extension of it would be amazing! :)

-Alessandro
My Website: www.havana24.net

letmethink

  • *
  • Posts: 2545
Maybe something like this would work better (includes zooming out); Use up and down arrow keys to zoom, arrows to move, and z to jump:

<a href="http://static.stencyl.com/games/32078-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/32078-0.swf</a>

Everything is still very rough, but it's a possibility.
~Letmethink

letmethink

  • *
  • Posts: 2545
Here is zooming out done completely engine side (So all I do withing Stencyl is set a variable. This is turning out to be pretty interesting. For now use down to zoom out (and then up to zoom back in to normal leve).

<a href="http://lmtproductions.weebly.com/uploads/2/0/7/9/20793336/tank_men_game.swf" target="_blank" class="new_win">http://lmtproductions.weebly.com/uploads/2/0/7/9/20793336/tank_men_game.swf</a>
~Letmethink

havana24

  • *
  • Posts: 508
Amazing! :D
Great work!
My Website: www.havana24.net


letmethink

  • *
  • Posts: 2545
Not to bring up an old topic, but tada (use 1 and 2 to zoom in and out). I think this performs better than my previous attempts:

<a href="http://static.stencyl.com/games/33886-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/33886-0.swf</a>

If you fall out of the world press z to generate a new one. Click to place blocks and shift click to remove them. I was planning on showing this in a dynamic state, but couldn't find something I was happy with yet.

« Last Edit: March 30, 2016, 07:22:41 am by letmethink »
~Letmethink