Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Screen wrap with views  (Read 1278 times)

0 Members and 1 Guest are viewing this topic.

smilesprower

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Screen wrap with views
« on: October 29, 2016, 12:42:13 pm »
I am looking for advice to approach this problem.

The game will be 4 screens across.
The view will be 1 screen in size.
My player will always be in the centre of the screen.
When the player centre x point > 4th screen centre you should see the 1st screen again.

Thanks in advance

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11037
    • View Profile
    • development blog
    • Email
Re: Screen wrap with views
« Reply #1 on: October 29, 2016, 01:07:36 pm »
One possibility is to just render screen 1 at the place of screen 5 and as soon as screen 4 isn't visible anymore you reset the view to screen 1. The same goes for screen 4, you just redraw it at screen 0's position and as soon as screen 1 isn't visible anymore you reset the view to the screen 4.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/