|
1 | 1 | Lua Storyboard
|
2 | 2 | ==============
|
3 | 3 |
|
4 |
| -Lua storyboard is simply a Lua script which controls how objects shown behind the simulator. |
5 |
| -Please note that Lua script running as Lua storyboard is sandboxed, which means most of `love` |
6 |
| -functions doesn't exist in here or modified to prevent alteration of the rendering state, and |
7 |
| -to prevent malicious Lua storyboard script writing anywhere. |
| 4 | +Lua storyboard is simply a Lua script which controls how objects shown behind the simulator, |
| 5 | +hence it's named Lua storyboard. Please note that Lua script running as Lua storyboard is |
| 6 | +sandboxed, which means most of `love` functions doesn't exist in here or modified to prevent |
| 7 | +alteration of the rendering state, and to prevent malicious Lua storyboard from running. |
8 | 8 |
|
9 | 9 | Storyboard Entry Points
|
10 | 10 | =======================
|
@@ -33,7 +33,8 @@ Parameters:
|
33 | 33 | Storyboard Functions
|
34 | 34 | ====================
|
35 | 35 |
|
36 |
| -This function only exist on storyboard lua script. |
| 36 | +This function is exported explicitly by DEPLS with `DEPLS.StoryboardFunctions` |
| 37 | +table, thus it only exist on storyboard lua script. |
37 | 38 |
|
38 | 39 | *************************************************
|
39 | 40 |
|
@@ -172,3 +173,100 @@ Parameters:
|
172 | 173 | * `path` - The image path
|
173 | 174 |
|
174 | 175 | Returns: Image handle or `nil` on failure
|
| 176 | + |
| 177 | +************************************************* |
| 178 | + |
| 179 | +### `number SetNotesSpeed([number notes_speed])` |
| 180 | + |
| 181 | +Get or set notes speed |
| 182 | + |
| 183 | +Parameters: |
| 184 | + |
| 185 | +* `notes_speed` - Note speed, in milliseconds. 0.8 notes speed in SIF is equal to 800 in here |
| 186 | + |
| 187 | +Returns: Previous notes speed |
| 188 | + |
| 189 | +> This function throws error if notes_speed is less than 400ms |
| 190 | +
|
| 191 | +************************************************* |
| 192 | + |
| 193 | +### `number SetPlaySpeed([number speed_factor])` |
| 194 | + |
| 195 | +Get or set play speed. This affects how fast the live simulator are |
| 196 | + |
| 197 | +Parameters: |
| 198 | + |
| 199 | +* `speed_factor` - The speed factor, in decimals. 1 means 100% speed (runs normally) |
| 200 | + |
| 201 | +Returns: Previous play speed factor |
| 202 | + |
| 203 | +> This function throws error if speed_factor is zero or less |
| 204 | +
|
| 205 | +Additional Storyboard Functions |
| 206 | +=============================== |
| 207 | + |
| 208 | +These functions were declared as global function in DEPLS, thus it also can be used in storyboards too |
| 209 | + |
| 210 | +************************************************* |
| 211 | + |
| 212 | +### `number,number,number HSL(number h, number s, number l)` |
| 213 | + |
| 214 | +Parameters: |
| 215 | + |
| 216 | +* `h` |
| 217 | + |
| 218 | +* `s` |
| 219 | + |
| 220 | +* `l` |
| 221 | + |
| 222 | +Returns: R, G, and B color (3 values) |
| 223 | + |
| 224 | +Storyboard Callback Functions |
| 225 | +============================= |
| 226 | + |
| 227 | +The stoyboard also can accept callbacks for specific event. You have to |
| 228 | +declare the callback function as global in your storyboard. |
| 229 | + |
| 230 | +Below is the list of storyboard callback functions: |
| 231 | + |
| 232 | +************************************************* |
| 233 | + |
| 234 | +### `void OnNoteTap(number pos, number accuracy, number distance, number attribute, boolean is_star, boolean is_simul, boolean is_token)` |
| 235 | + |
| 236 | +Triggered everytime note is tapped on screen |
| 237 | + |
| 238 | +Parameters: |
| 239 | + |
| 240 | +* `pos` - Idol unit position. 9 is leftmost |
| 241 | + |
| 242 | +* `accuracy` - The note tap accuracy. 1 for Perfect, 0.88 for Great, 0.8 for Good, 0.4 for Bad, and 0 for **Miss** |
| 243 | + |
| 244 | +* `distance` - The note distance from the idol unit position, in pixels |
| 245 | + |
| 246 | +* `attribute` - Note attribute. 1, 2, 3 are Smile, Pure, and Cool respectively. The others depends on beatmap type. |
| 247 | + |
| 248 | +* `is_star` - Is the note is a star note (dangerous note)? |
| 249 | + |
| 250 | +* `is_simul` - Is the note is a simultaneous note? |
| 251 | + |
| 252 | +* `is_token` - Is the note is a token note? |
| 253 | + |
| 254 | +************************************************* |
| 255 | + |
| 256 | +### `void OnLongNoteTap(boolean release, number pos, number accuracy, number distance, number attribute, boolean is_simul)` |
| 257 | + |
| 258 | +Triggered everytime long note is tapped (and currently holding) or released |
| 259 | + |
| 260 | +Parameters: |
| 261 | + |
| 262 | +* `release` - Is this a long note release callback? |
| 263 | + |
| 264 | +* `pos` - Idol unit position. 9 is leftmost |
| 265 | + |
| 266 | +* `accuracy` - The note tap accuracy. 1 for Perfect, 0.88 for Great, 0.8 for Good, 0.4 for Bad, and 0 for **Miss** (in this case, release will never be triggered) |
| 267 | + |
| 268 | +* `distance` - The note distance from the idol unit position, in pixels |
| 269 | + |
| 270 | +* `attribute` - Note attribute. 1, 2, 3 are Smile, Pure, and Cool respectively. The others depends on beatmap type. |
| 271 | + |
| 272 | +* `is_simul` - Is the note is a simultaneous note? (start holding only) |
0 commit comments