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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Sauce

Pages: [1]
1
Graphics / Scrolling backgrounds / wrapping sprites at screen edge
« on: April 25, 2010, 07:51:08 am »
I'm working on a simple platformer game with a few people for an assessment and I've hit a brick wall. We have a number of large textures (1080p) that we are using for the backgrounds, which we would like to tile throughout the entire level. Rather than manually place instances of the texture at every 1080 units horizontally, i've opted to write a class deriving from sf::Sprite that will automatically handle wrapping the texture when it reaches the edge of the screen.

I've tried numerous methods of achieiving this, including manipulating sf::View's before drawing the sprite, and manually calculating the appropriate coordinates, however I just haven't had any success. There's just too many factors to take into account, including sprite position in the world, View position, sprite's scale, etc (rotation will be ignored).

Does anyone have a suggestion (or better yet, working implementation) that could help me out? I've already wasted far too much time on this feature alone.

Pages: [1]