I have an object that I made called a ListBox, which stores a table of strings and displays them in a rectangle one after the other (one per line) If the user swipes up or down inside the ListBox, all of the texts displayed inside move up or down accordingly. This part works just fine, its just that nothing stops the text from displaying once it goes partway outside of the rectangle. Once a text completely leaves the rectangle, it ceases to be drawn until it reenters the rectangle. My issue is dealing with the text that is partly in and partly out of the rectangle. Does anyone have any suggestions? If possible, I’d like to avoid the following 2 things:
- Not drawing the text when any part of the text in is the bounding rectangle
2)Adding another shape around the edges of the ListBox, so it hides the text that is not inside the rectangle
If I have to, I’ll resort to one of the two above methods, but I wanted to see if anybody had come up with anyway to only draw the top half of a text, if that makes sense.