Hi,
I want to add a menu to my game that has the ability to scroll. My idea is to put all the elements of the menu on a layer and make the layer able to scroll. But I don't know how to scroll only one layer. Any ideas?
Thanks!
If you use layers, you might be able to play around with parallax to get only that layer to scroll.
You don't have to use layers though, you can just place and move your menu sprites up and down specifically.
oosyrag,
Thanks for your reply! Now would it be possible to put all the objects into a family and move them up and down when scrolling? How would I prevent the menu from scrolling offscreen?
Thanks again!
Develop games in your browser. Powerful, performant & highly capable.
You can use families.
To prevent from scrolling offscreen, you would use conditions to limit the event to only work within the range you specify.
If you place all your menu items inside the layout and set the layout's "Unbounded Scrolling" to No, then you should be able to stay inside the layout no matter how much you scroll out.
I think you should check out this template https://www.scirra.com/store/royalty-free-game-templates/swipe-level-selector-1006, it has a very smooth scrolling feel, sure it was made for level selection but I think you can easily adapt it to a general purpose game menu.