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

Author Topic: Very high resolution scrolling background  (Read 1313 times)

0 Members and 1 Guest are viewing this topic.

Cyraxx

  • Newbie
  • *
  • Posts: 8
    • View Profile
Very high resolution scrolling background
« on: May 04, 2014, 05:26:39 pm »
Hello!

We are stuck in the 2d platformer game we are programming. We are using Tiled to create maps and RapidXML to implement them. It was working with simple placeholder tilesets and one layer.
Now however we are trying to implement a scrolling background since the map will be really wide (100 tile where each tile is 128x128).
We would like to know whats the best way to load it? The background picture we have is 2048x2048 pixels.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Very high resolution scrolling background
« Reply #1 on: May 04, 2014, 06:23:56 pm »
If it's a static image you only have to load once, then there isn't much optimization to attempt aside from possibly loading only one portion at a time as needed.  But don't attempt that until you've actually tried loading the whole thing at once and found it to be too slow.  I've loaded 1080p textures in SFML before without any noticeable delay, so I doubt there's any need to do this for 2048.

For the scrolling part, use views.  One of the official tutorials discusses that.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Very high resolution scrolling background
« Reply #2 on: May 04, 2014, 06:52:09 pm »
2048x2048 large textures are only supported by "modern" graphic cards, thus if you want also people with older specs to run your game, you might find Thor's BigTexture and BigSprite interesting.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything