When you put Solar2D's widget.newScrollView inside of another widget.newScrollView, there is some funky behavior. This plugin allows you to fix that by using embeddableScrollview.create.
https://www.youtube.com/watch?v=04L_njW_MjM
{
plugins = {
["plugin.embeddablescrollview"] = {
publisherId = "io.joehinkle",
},
},
}
Import
lua local embeddableScrollview = require "plugin.embeddablescrollview"
Extra Options
With an embedded scrollview you get a few extra parameters added to the built-in scrollview:
- displayObjectToGiveTouchFocusFromHorizontalScroll
- displayObjectToGiveTouchFocusFromVerticalScroll
- displayObjectToGiveTouchFocusFromFunctionCall
Scrollview, but gives aways horizontal scrolls
myEmbeddedScrollView = embeddableScrollview.create({
...
displayObjectToGiveTouchFocusFromHorizontalScroll = parentScrollView,
...
})
Scrollview, but gives aways vertical scrolls
myEmbeddedScrollView = embeddableScrollview.create({
...
displayObjectToGiveTouchFocusFromVerticalScroll = parentScrollView,
...
})
Scrollview, but can manually give away
myEmbeddedScrollView = embeddableScrollview.create({
...
displayObjectToGiveTouchFocusFromFunctionCall = parentScrollView,
...
})
-- somewhere later in code
myEmbeddedScrollView:giveFocusAway() -- gives it to whatever was set in as displayObjectToGiveTouchFocusFromFunctionCall