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.
|
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.
|
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.
|
||||||
Set the `scrollDistance` value to **`compound.compoundWidth * amountOfLines`**, where `amountOfLines` represents how many lines you want to instantly scroll when pressing the scroll 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):
|
In our example, we could create the following button to scroll "page by page" instantly (without any scrolling animation):
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
compoundScroll(
|
compoundScroll(
|
||||||
Slots.RowOneSlotNine,
|
Slots.RowSixSlotNine,
|
||||||
ItemStack(Material.PAPER), compound,
|
ItemStack(Material.PAPER), compound, scrollLines = 6
|
||||||
scrollDistance = compound.compoundWidth * 6
|
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user