SFML community forums

Help => General => Topic started by: mafiozy on March 15, 2023, 05:50:49 pm

Title: Scrolling
Post by: mafiozy on March 15, 2023, 05:50:49 pm
Hello everyone ;D Can i ask you. How to make scrolling in sfml? Im doing like tasklist, there are rectangleshapes and text. So, they are in tasklist window(another, but big rectangleshape). So, i need to make to dissappear small rectangleshapes as i move them outside of tasklist, as it was like outside of tasklist would be some figures that are drawed in higher order(but outside of big rectangle nothing but colored background).  In advance want to thank you. And thank for previous answered questions( couldn't thank you because dont know how to answer in topics)/
Title: Re: Scrolling
Post by: Hapax on March 18, 2023, 08:27:34 am
It sounds like you want to clips objects to a rectangle shape. Is that correct?
If so, there are a few options I can think of right now:

The first one is the simplest but the third one is probably the best one if you can get to grips with views and viewports (they're difficult to understand at first but quite easy to use once you grasp the concept). The second one should be easy enough but it's up to you if creating a render texture just for this is worth it ;)