Update compounds.md
This commit is contained in:
@@ -80,16 +80,15 @@ You can use the `reverse` parameter and set it to true to create a button that s
|
||||
|
||||
Instant (or hard) scrolling means that no scrolling animation will be displayed.
|
||||
|
||||
To implement instant scrolling, leave `scrollTimes` at its default value (1) and instead modify the `scrollDistance` value.
|
||||
|
||||
Set the `scrollDistance` value to **`compound.compoundWidth * amountOfLines`**, where `amountOfLines` represents how many lines you want to instantly scroll when pressing the scroll button.
|
||||
To implement instant scrolling, leave `scrollTimes` at its default value (1) and instead modify the `scrollLines` value.
|
||||
Set `scrollLines` to the amount of lines you want to instantly scroll by pressing the button.
|
||||
If you want to scroll "page by page", set `scrollLines` to the height of the compound.
|
||||
|
||||
In our example, we could create the following button to scroll "page by page" instantly (without any scrolling animation):
|
||||
|
||||
```kotlin
|
||||
compoundScroll(
|
||||
Slots.RowOneSlotNine,
|
||||
ItemStack(Material.PAPER), compound,
|
||||
scrollDistance = compound.compoundWidth * 6
|
||||
Slots.RowSixSlotNine,
|
||||
ItemStack(Material.PAPER), compound, scrollLines = 6
|
||||
)
|
||||
```
|
||||
|
Reference in New Issue
Block a user