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:
- Draw all the items and move/scroll them to position.
Then, draw rectangles around the tasklist "window" rectangle to fill them with background colour. Obviously, this would need to happen before drawing over those fills. - Create a render texture of the same size as the tasklist window.
Draw the items to that.
Then, create a sprite and draw that render texture to the window. - Create a viewport that fills the area of the tasklist window and then you can just draw to that and it will clip it automatically.
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