Author Topic: Screen Coordinates  (Read 1430 times)

devilishloki

  • Member
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Screen Coordinates
« on: Tue, May 3, 2011 »
I have a map in my game that has width of a screen, but has much more in height than screen.

I was wondering is there a simple way in flixel to get coordinates of left upper corner of the screen?

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: Screen Coordinates
« Reply #1 on: Tue, May 3, 2011 »
Do you mean the top left coordinates if you are scrolled down the map a bit? (because the top left coordinate is always 0,0 - but I guess you mean the game coordinates?)
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

devilishloki

  • Member
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Screen Coordinates
« Reply #2 on: Tue, May 3, 2011 »
 :D yes, i mean game coordinates. The top left corner of screen(or buffer) on the map.

Is there a way to get them?

auriplane

  • Snails!!
  • Contributor
  • ****
  • Posts: 497
  • Karma: +1/-0
  • Snails!!
    • View Profile
Re: Screen Coordinates
« Reply #3 on: Tue, May 3, 2011 »
What version of Flixel?

In 2.43, FlxG.scroll.x and .y, though you may need to subtract these values rather than add them.

In 2.51, I think it's FlxG.camera.scroll, but I'm not sure.

devilishloki

  • Member
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Screen Coordinates
« Reply #4 on: Tue, May 3, 2011 »
great, that is it! thanks!