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 - crbn-hash

Pages: [1]
1
Window / Using Views for Multiple Levels
« on: May 01, 2020, 05:49:29 pm »
I'm looking to display a train track that extends horizonally out of the window. I would like to display the track as wrapping, and thus be able to scroll up and down to view the full length of the track - instead of including logic that would break the track up as it is rendered.

I would think that I could define a second view which contained the track outside the window, and then set a viewport stacked under the default view:

View view1 = getDefaultView();                             //contains first portion of track
View view2(offscreen  track x, offscreen track y);    //contains second portion of track

view2.setViewport( 0 , offset from view1.y);           //display second portion of track underneath first portion
                                                                          //scroll down to view this portion

I've consulted:

https://en.sfml-dev.org/forums/index.php?topic=11526.msg80208#msg80208

https://en.sfml-dev.org/forums/index.php?topic=23574.0

and a few other threads to no avail.

Thanks for any input!

Pages: [1]
anything