-
Notifications
You must be signed in to change notification settings - Fork 7
Initialization Options
Kir_Antipov edited this page Aug 3, 2019
·
1 revision
This page contains information about initialization options' structure.
You can immediately see the entire list of available options, if you'll take a look at this object with the default values:
let options = {
spacing = 10,
acceleration = 350,
fps = 40,
audio = "libs/vanillaRoulette/click.wav",
selector = ":scope > *",
stopCallback = null,
startCallback = null
};
Now let's look at each parameter individually :)
- Default value:
10
- Description: The distance between two prizes in roulette (in pixels)
- Default value:
350
- Description: Roulette acceleration coefficient (in fact, this is a deceleration coefficient, but deceleration is a special case of acceleration 😺). The value of this parameter is directly proportional to the initial roulette speed!
- Default value:
40
- Description: Frames Per Second, as usual. I highly recommend using values between 40 and 240
- Default value:
"libs/vanillaRoulette/click.wav"
- Description:
Each time a roulette passes new prize, a click sound is played. You can control which sound will be played by this option. You can use the following values:
-
null
: Sound will not play -
"some/string"
: Link to sound for playing -
object
: If you need a special logic for playing sound, you can transfer here an object for which the play function is defined
- Default value:
":scope > *"
- Description: Roulette child selector
- Default value:
null
- Description: The function that will be called when the roulette will be stopped
You can read more about callbacks here.
- Default value:
null
- Description: The function that will be called when the roulette will be started
You can read more about callbacks here.
Better to see once than hear a hundred times, so be sure to visit our demo page! :)