# Scroll menu issues

**URL:** https://discourse.processing.org/t/scroll-menu-issues/18561
**Category:** Coding Questions
**Created:** [March 10, 2020, 1:53pm UTC](https://discourse.processing.org/t/scroll-menu-issues/18561 "2020-03-10T13:53:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [March 10, 2020, 1:53pm UTC](https://discourse.processing.org/t/scroll-menu-issues/18561/1 "2020-03-10T13:53:12Z")

</div>

How does one go about coding such a structure, I have an example however I’m not sure how to apply masks. The issue is that every list item has a particular height, and position, the scroll bar amends their position and if its current position is within the display window then it is drawn.

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1f83142f36a05739b377ae311f9ea10459ee1669.png)

![Screen Shot 03-10-20 at 01.46 PM 001](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8ae7dde409d1f72fec54eda290f5b7de6fc9c5a3.jpeg)

But here is what happens when the items position is higher than the viewing window. As its not drawn we have a blank. I do understand I could use a rectangle to mask everything that’s above but then this will cause problems with other gui elements as these are floating windows and would be expected to be drawn above everything else.

Any input would be great thanks.

//--------------------------------------------------------------

there is unfortunately no code with this as it is a pretty big project.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [March 11, 2020, 8:06am UTC](https://discourse.processing.org/t/scroll-menu-issues/18561/2 "2020-03-11T08:06:49Z")

</div>

Don’t use a mask maybe

Instead the scroll bar tells the for loop where to start

for(int i=valueFromScrollbar;i\<valueFromScrollbar+20;i++){

Thus he draws only certain lines

The scrolling is line by line not by pixel

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 14, 2020, 8:33pm UTC](https://discourse.processing.org/t/scroll-menu-issues/18561/3 "2020-03-14T20:33:54Z")

</div>

Some other options include:

- controlP5 : ScrollableList [http://www.sojamo.de/libraries/controlP5/reference/controlP5/ScrollableList.html](http://www.sojamo.de/libraries/controlP5/reference/controlP5/ScrollableList.html)
- G4P : GDropList [http://www.lagers.org.uk/g4p/ref/classg4p\_\_controls\_1\_1\_g\_drop\_list.html](http://www.lagers.org.uk/g4p/ref/classg4p__controls_1_1_g_drop_list.html)

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [March 14, 2020, 9:48pm UTC](https://discourse.processing.org/t/scroll-menu-issues/18561/4 "2020-03-14T21:48:32Z")

</div>

Thanks but I wanted to use my own code, Ive solved this using scale.
