Author Topic: default camera  (Read 949 times)

Chelnok

  • Contributor
  • ****
  • Posts: 257
  • Karma: +0/-0
    • View Profile
default camera
« on: Sun, Jul 31, 2011 »
I was just wondering am i doing this right:

Code: [Select]
cam = new FlxCamera(0,19, FlxG.width, 400);
//all other code..
FlxG.cameras.pop(); // pop the default camera away
FlxG.addCamera(cam);

When i changed cam x and height i found this default camera, so i poped it out :)

Just curious ..i usually need only one camera, and still i always have this line: cam = new FlxCamera(0,0,FlxG.width,FlxG.height) in override create(). Does Flixel do the rendering for both cams?

zadvornykh

  • Active Member
  • ***
  • Posts: 205
  • Karma: +1/-0
    • View Profile
Re: default camera
« Reply #1 on: Sun, Jul 31, 2011 »
If you only need one camera, you can just stick with the default one. No reason to create and override a custom one. Just change the properties of the default.

Chelnok

  • Contributor
  • ****
  • Posts: 257
  • Karma: +0/-0
    • View Profile
Re: default camera
« Reply #2 on: Mon, Aug 1, 2011 »
Right, i always thought that adding cam will override default one, but that actually doesnt make any sense :)

c023-DeV

  • Game Artisan
  • Active Member
  • ***
  • Posts: 176
  • Karma: +0/-0
    • View Profile
    • DeV-ZoO
Re: default camera
« Reply #3 on: Mon, Aug 1, 2011 »
I actually ran into some problems because of not using the default cam (wondering if it was because I didnt pop it out)
But it seemed to mess up my FlxG.Mouse.x ?! (Turned the World coordinates into screen coordinates)

Well just FYI sticking with the default sure brings some benifits I guess.
If you aint got no dedication, you won't get no education!