create a pause on a big screen

Shishkov

  • Posts: 169
Dear colleagues,

I have a small screen resolution 640x480 and a big scene resolution - 1700x1200. So when my actor moves, game camera also moves. And I want to create a big square 200x200 in a center of the screen when "game pause" button is pressed. But I don't know how to calculate a center of a camera moving in order to create this square in the center of the  screen. If I try using actors coordinate, the square will appear everywhere rather than appear only in the center of the screen because actor's coordinate can vary from left-top corner to right-bottom corner.

Please help me to solve that problem.

Tuo

  • *
  • Posts: 2469
You could just use the x/y of the camera. If you want a square that is 200x200 that is centered inside of a screen of 640x480, then you can "create the square at x: [x of camera + 220], y: [y of camera + 140]" (assuming that the creation is inside of the scene behavior, else it would be relative to the player and you will have to adjust by subtracting off the x/y of the player).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Shishkov

  • Posts: 169
Thank you very much for your desire to help me.
but where and how can I find x/y of the camera? Should I somehow calculate it on my own?


Hectate

  • *
  • Posts: 4643
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Shishkov

  • Posts: 169
I tryed using [x of camera + 220], y: [y of camera + 140]  and it was useless. Only screen width and creen height were helpful but now I can't create actors using this method. It create actors only in one place rather than create it where I want using screen width and screen height.
What do you recommend?

Shishkov

  • Posts: 169
The problem is solved.
Very interesting in this case I endeavoured to use [x of camera + 220], y: [y of camera + 140] and it helped me!!!)))
Anyway, thanks a lot