Difference between revisions of "Live Simulator: 2/Storyboard"

(DEPLS2 Storyboard.)
 
m (Blanked page (Obsoleted. Instead of use new version : https://github.com/MikuAuahDark/livesim2/blob/master/docs/Storyboard.md))
 
Line 1: Line 1:
Lua storyboard is simply a Lua script which controls how objects shown behind the simulator,
 
hence it's named Lua storyboard. Please note that Lua script running as Lua storyboard is
 
sandboxed, which means most of `love` functions doesn't exist in here or modified to prevent
 
alteration of the rendering state, and to prevent malicious Lua script from running.
 
  
== Storyboard Entry Points ==
 
Lua storyboard needs to create this function in global namespace. Although there's way to use
 
it without this entry points by using coroutines, but it's usage is discouraged and only
 
provided for legacy DEPLS storyboard Lua script.
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">Initialize()</source>
 
Storyboard initialization. This function is called everytime storyboard is loaded. Load your
 
images here
 
=== Arguments ===
 
None.
 
=== Returns ===
 
Nothing.
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">Update(deltaT)</source>
 
Storyboard frame update. Draw and calculate everything for the storyboard in here.
 
=== Arguments ===
 
{{param|number|deltaT|Time since the last update in milliseconds}}
 
=== Returns ===
 
Nothing.
 
 
== Storyboard Functions ==
 
=== Synopsis ===
 
<source lang="lua">SetLiveOpacity(opacity)</source>
 
Sets the Live Show! image opacity. This includes unit, header, notes, and more.
 
=== Arguments ===
 
{{param|number|opacity (255)|The opacity, range from 0-255. 0 for invisible, 255 for opaque (fully visible)}}
 
=== Returns ===
 
Nothing.
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">SetBackgroundDimOpacity(opacity)</source>
 
Sets background blackness (but not entirely black)
 
=== Arguments ===
 
{{param|number|opacity (255)|Background blackness, from 0-255. 0 for full black (approx. 190 blackness), 255 for full bright}}
 
=== Returns ===
 
Nothing.
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">elapsedTime = GetCurrentElapsedTime()</source>
 
Sets background blackness (but not entirely black)
 
=== Arguments ===
 
None.
 
=== Returns ===
 
{{param|number|elapsedTime|Elapsed time, in milliseconds. Negative value means simulator is not started yet}}
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">delay = GetLiveSimulatorDelay()</source>
 
Get live simulator delay. Delay before live simulator is shown
 
=== Arguments ===
 
None.
 
=== Returns ===
 
{{param|number|delay|Live simulator delay, in milliseconds}}
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">video = LoadVideo(path)</source>
 
Load video file. Directory is relative to current beatmap folder
 
{{notice|AquaShineVideo requires at least FFmpeg v3.0 available. This is the default for Windows release and Android release for x86 architecture. If none is found, it only loads video using [[love.graphics.newVideo]].}}
 
=== Arguments ===
 
{{param|string|path|Video filename}}
 
=== Returns ===
 
{{param|Video or AquaShineVideo|video|New drawable <code>Video</code> object (identical to [[Video]]), or <code>nil</code> on failure}}
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">image = LoadImage(path)</source>
 
Load image. Directory is relative to current beatmap folder.
 
=== Arguments ===
 
{{param|string|path|Image filename}}
 
=== Returns ===
 
{{param|Image|image|New drawable [[Image]], or <code>nil</code> on failure}}
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">font = LoadFont(path, size)</source>
 
Load image. Directory is relative to current beatmap folder.
 
=== Arguments ===
 
{{param|string|path ("MTLmr3m.ttf")|Font file}}
 
{{param|number|size (14)|Font size}}
 
=== Returns ===
 
{{param|Font|font|New [[Font]], or <code>nil</code> on failure}}
 
 
----
 
 
=== Synopsis ===
 
<source lang="lua">contents = ReadFile(path)</source>
 
Reads the contents of file. Directory is relative to current beatmap folder
 
=== Arguments ===
 
{{param|string|path|Filename}}
 
=== Returns ===
 
{{param|string|contents|The file contents, or <code>nil</code> on failure}}
 
 
== TODO ==
 
* Complete it.
 

Latest revision as of 12:43, 17 December 2019