Skip to content

Commit

Permalink
Add v5 Video function pages
Browse files Browse the repository at this point in the history
  • Loading branch information
MegAmi24 committed Oct 17, 2024
1 parent 8725ef7 commit 0468f52
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/RSDKv3/Functions/Graphics/LoadSpriteSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Loads a spritesheet and assigns the ID to `Object.SpriteSheet`. The spritesheet
## Parameters
`Path`

: The file path to load the sprite sheet from, relative to `Data/Sprites/`.
: The file path of the spritesheet to load, relative to `Data/Sprites/`.

## Return Value
None.
Expand Down
2 changes: 1 addition & 1 deletion docs/RSDKv3/Functions/Misc/LoadVideo.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LoadVideo
# LoadVideo <small>(RSDKv3)</small>

## Description
Loads and plays a video.
Expand Down
2 changes: 1 addition & 1 deletion docs/RSDKv4/Functions/Graphics/LoadSpriteSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Loads a spritesheet and assigns the ID to `object.spritesheet`. The spritesheet
## Parameters
`path`

: The file path to load the sprite sheet from, relative to `Data/Sprites/`.
: The file path of the spritesheet to load, relative to `Data/Sprites/`.

## Return Value
None.
Expand Down
6 changes: 6 additions & 0 deletions docs/RSDKv5/Functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
| [**CheckSceneFolder**](Stages/CheckSceneFolder.md) | Reads the name of the current stage's folder. |
| [**LoadScene**](Stages/LoadScene.md) | Loads a stage based on `SceneInfo->activeCategory` and `SceneInfo->listPos`. |

## Videos & Images
| Function | Description |
| ------------------------------------ | ---------------------------- |
| [**LoadVideo**](Videos/LoadVideo.md) | Loads and plays a video. |
| [**LoadImage**](Videos/LoadImage.md) | Loads and displays an image. |

## Miscellaneous
| Function | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions docs/RSDKv5/Functions/SpriteSheets/LoadSpriteSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Loads a spritesheet and returns the ID of it.
## Parameters
`path`

: The file path to load the spritesheet from, relative to `Data/Sprites/`. Spritesheets may **ONLY** be in GIF format.
: The file path of the spritesheet to load, relative to `Data/Sprites/`. Spritesheets may **ONLY** be in GIF format.

`scope`

: The asset's scope, may be `SCOPE_GLOBAL` or `SCOPE_STAGE`.
: The asset's scope. May be `SCOPE_GLOBAL` or `SCOPE_STAGE`.

## Return Value
Returns the ID of the loaded spritesheet as a `uint16`. The return value will be `-1` if the spritesheet failed to load.
Expand Down
2 changes: 1 addition & 1 deletion docs/RSDKv5/Functions/Stages/ForceHardReset.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Sets whether the next stage reload should reload all assets.

!!! note
This function does not reload the scene by itself; you must call [LoadStage()](LoadStage.md) manually.
This function does not reload the scene by itself; you must call [LoadScene()](LoadScene.md) manually.

## Parameters
`shouldHardReset`
Expand Down
53 changes: 53 additions & 0 deletions docs/RSDKv5/Functions/Videos/LoadImage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# LoadImage

## Description
Loads and displays an image.

## Parameters
`filename`

: The file path of the image to load, relative to `Data/Images/`. Images may **ONLY** be in PNG format and **MUST** have a resolution of 1024x512 pixels.

!!! note
Prior to REV02, RSDKv5 used the TGA format for images instead of PNG.

`displayLength`

: The amount of time, in seconds, to show the image on-screen (excluding the time during fading in/out).

`fadeSpeed`

: The amount of time, in seconds, to take for the image to fade in/out.

`skipCallback`

: The function that will be called every frame the image is shown to determine if it should be skipped. The function must return a `bool32` value. Setting this to `NULL` will make the image unskippable.

## Return Value
None.

## Syntax
=== "C"

``` c
RSDK.LoadImage(const char *filename, double displayLength, double fadeSpeed, bool32 (*skipCallback)())
```

=== "C++"

``` cpp
Video::LoadImage(const char *filename, double displayLength, double fadeSpeed, bool32 (*skipCallback)())
```

## Example
=== "C"

``` c
RSDK.LoadImage("Image.png", 32.0, 1.0, MyObject_ImageSkipCB);
```

=== "C++"

``` cpp
Video::LoadImage("Image.png", 32.0, 1.0, ImageSkipCB);
```
46 changes: 46 additions & 0 deletions docs/RSDKv5/Functions/Videos/LoadVideo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# LoadVideo <small>(RSDKv5)</small>

## Description
Loads and plays a video.

## Parameters
`filename`

: The file path of the video to load, relative to `Data/Videos/`. Videos may **ONLY** be in OGV format.

`startDelay`

: The amount of time, in seconds, to wait before playing the video after loading it.

`skipCallback`

: The function that will be called every frame during the video to determine if it should be skipped. The function must return a `bool32` value. Setting this to `NULL` will make the video unskippable.

## Return Value
Returns `true` as a `bool32` if the video loaded successfully; otherwise, returns `false`.

## Syntax
=== "C"

``` c
RSDK.LoadVideo(const char *filename, double startDelay, bool32 (*skipCallback)());
```

=== "C++"

``` cpp
Video::LoadVideo(const char *filename, double startDelay, bool32 (*skipCallback)());
```

## Example
=== "C"

``` c
RSDK.LoadVideo("Opening.ogv", 0.0, MyObject_VideoSkipCB);
```

=== "C++"

``` cpp
Video::LoadVideo("Opening.ogv", 0.0, VideoSkipCB);
```
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ nav:
- CheckValidScene: RSDKv5/Functions/Stages/CheckValidScene.md
- CheckSceneFolder: RSDKv5/Functions/Stages/CheckSceneFolder.md
- LoadScene: RSDKv5/Functions/Stages/LoadScene.md
- Videos & Images:
- LoadVideo: RSDKv5/Functions/Videos/LoadVideo.md
- LoadImage: RSDKv5/Functions/Videos/LoadImage.md
- Miscellaneous:
- NotifyCallback: RSDKv5/Functions/Misc/NotifyCallback.md
- HasNotifyCallback: RSDKv5/Functions/Misc/HasNotifyCallback.md
Expand Down

0 comments on commit 0468f52

Please sign in to comment.