Jump to content

Syntax for adding camera


Recommended Posts

Hi guys,


I'm a newb here. I was following 0.9.5 and made some prototype. I noticed there's no more from previous 1.0 and shown in it's test and now in 1.0.1


  The latest examples use only game.camera(tilemaps). I also took a look at the Camera.js core and there's no 


 method(hiding sprites/objects from the camera/ like 


 in 0.9.5) and 


. Is it now included anymore, or I just need to wrap the camera somehow and draw a rectangle around it?


Thanks, and I'm really not much in a hurry and looking forward to more examples/demos =). Congratulations on the 1.0 release btw.



Link to comment
Share on other sites

Sorry but I had to drop multiple camera support. It was a choice between either using Pixi for the rendering, thus getting WebGL support and lots of other cool things, or having Canvas only and keeping multiple cameras. As I hadn't seen anyone make a game using them I figured it would be safer to drop them and gain all the benefits of Pixi instead. To be honest I'm glad I did :) But it does mean all of those camera commands are gone for now.

Link to comment
Share on other sites

Hi rich,


I understand and fully support your decision, I was making a minimap feature for the game with fog of war(much like the classic rts games eg. starcraft).

Although, I was using around 3 camera's to get the desired effect. I still have a couple of ideas on how to implement it with the current version, and I'm currently strolling around the library and familiarizing myself.


Any ideas that might come in handy?


Btw, am I right that there is just 1 camera for the game now which is 


and you can't create another instance of cameras?


Appreciate the reply =)

Link to comment
Share on other sites

There is just 1 camera, which is actually a property of the World object, but I put in game.camera as a handy proxy for it to save on code length.


You can create new cameras and swap world.camera for them but really there's no point right now. I have set-up the camera class so that it can drop into a multi camera system once there is a clean way of dealing with that in Pixi, but it's not a trivial thing to add.


For a minimap I personally would use a RenderTexture and draw to that.

Link to comment
Share on other sites

  • 1 month later...

Rich, could you please name me exactly release when multiple camera support have been dropped?

I need nearly six cameras in my game and, it seems, Phaser is only JS engine that has (have had) multiple cameras, so I want to use latest release with multiple cameras.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...