Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
5e43ec9251 | |||
a28be52f07 | |||
49f5bd326f |
7 changed files with 140 additions and 6 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,6 +1,3 @@
|
||||||
target/
|
target/
|
||||||
*.import
|
*.import
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.d
|
|
|
@ -6,8 +6,8 @@ reloadable = true
|
||||||
[libraries]
|
[libraries]
|
||||||
linux.debug.x86_64 = "res://addons/MiniDemoTools/librust.so"
|
linux.debug.x86_64 = "res://addons/MiniDemoTools/librust.so"
|
||||||
linux.release.x86_64 = "res://addons/MiniDemoTools/librust.so"
|
linux.release.x86_64 = "res://addons/MiniDemoTools/librust.so"
|
||||||
windows.debug.x86_64 = "res://addons/MiniDemoTools/rust.dll"
|
##windows.debug.x86_64 = "res://../rust/target/debug/librust.dll"
|
||||||
windows.release.x86_64 = "res://addons/MiniDemoTools/rust.dll"
|
##windows.release.x86_64 = "res://../rust/target/release/librust.dll"
|
||||||
|
|
||||||
|
|
||||||
[icons]
|
[icons]
|
||||||
|
|
5
docs/classes/dynamicsubviewport.md
Normal file
5
docs/classes/dynamicsubviewport.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# DynamicSubViewport
|
||||||
|
`inherits SubViewport`
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
This class functions identically to the `SubViewport` class, except it scales automatically to the root viewport.
|
72
docs/classes/manager.md
Normal file
72
docs/classes/manager.md
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
|
||||||
|
# Manager
|
||||||
|
`inherits SubViewport`
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
This is the backbone of the demo.
|
||||||
|
|
||||||
|
The `Manager` is responsible for the scene management and background music.
|
||||||
|
|
||||||
|
#### Setup
|
||||||
|
1. Create a new scene with a type of `Manager` and make it the main scene.
|
||||||
|
2. Set the `Bgm` from either in-editor or through code.
|
||||||
|
3. Add scenes to be run in order with `register_scene()`
|
||||||
|
4. Create a child of type `AnimationPlayer` and create a new animation with a `Call Method Track`
|
||||||
|
5. Add keyframes at points where you wish the scene to be changed. Call method `set_scene(scene_number)`.
|
||||||
|
6. Call `start_audio()` and `$AnimationPlayer.play()` to start the bgm and scene timeline
|
||||||
|
|
||||||
|
#### Example script
|
||||||
|
```gdscript
|
||||||
|
extends Manager
|
||||||
|
|
||||||
|
var scene1: PackedScene = preload("res://entities/scene_1.tscn");
|
||||||
|
var scene2: PackedScene = preload("res://entities/scene_2.tscn");
|
||||||
|
var scene3: PackedScene = preload("res://entities/scene_3.tscn");
|
||||||
|
var scene4: PackedScene = preload("res://entities/scene_4.tscn");
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
register_scene(scene1);
|
||||||
|
register_scene(scene2);
|
||||||
|
register_scene(scene3);
|
||||||
|
register_scene(scene4);
|
||||||
|
|
||||||
|
start_audio();
|
||||||
|
$AnimationPlayer.play("timeline");
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
| Type | Name | Default |
|
||||||
|
| -------------------- | ----------- | ------- |
|
||||||
|
| `String` | bgm | `Null` |
|
||||||
|
| `Array[PackedScene]` | scenes | `Array[PackedScene]` |
|
||||||
|
| `int` | beat_count (unused) | `Null` |
|
||||||
|
|
||||||
|
`bgm`
|
||||||
|
Stores the path to the background music as `String`
|
||||||
|
|
||||||
|
`scenes` stores the registered scenes. Usually you shouldn't edit this manually
|
||||||
|
|
||||||
|
`beat_count` Unused
|
||||||
|
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
| Returns | Name |
|
||||||
|
| ------- | ---- |
|
||||||
|
| `void` | `set_scene(number: int)` |
|
||||||
|
| `void` | `register_scene(scene: PackedScene)` |
|
||||||
|
| `void` | `start_audio()` |
|
||||||
|
|
||||||
|
#### set_scene(number: int)
|
||||||
|
Changes the current scene to the scene at index `number` in `scenes`
|
||||||
|
|
||||||
|
#### register_scene(scene: PackedScene)
|
||||||
|
Registers the `scene` to the manager.
|
||||||
|
|
||||||
|
Each registered scene is added to `scenes` and gets preloaded into memory.
|
||||||
|
|
||||||
|
The scene number is the scene's index in `scenes`, so the first scene registered gets number `0`, the next one gets number `1` and so on.
|
||||||
|
|
||||||
|
#### start_audio()
|
||||||
|
Calling this function will start playing back the `bgm` on the main bus.
|
BIN
docs/classes/scramblingtext.gif
Normal file
BIN
docs/classes/scramblingtext.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
49
docs/classes/scramblingtext.md
Normal file
49
docs/classes/scramblingtext.md
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# ScramblingText
|
||||||
|
`inherits Label`
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
This class implements a 'glitch' effect for a label.
|
||||||
|
|
||||||
|
![showcase](scramblingtext.gif)
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
| Type | Name | Default |
|
||||||
|
| ---- | ---- | ------- |
|
||||||
|
| `String` | chars | `ABCDEFGHIJKLMNOPQRSTUVWXYZ124567890` |
|
||||||
|
| `Bool` | scrambling | `False` |
|
||||||
|
| `Float` | speed | `15.0` |
|
||||||
|
| `Float` | duration | `1.0` |
|
||||||
|
| `Bool` | infinite | `False` (overridden by editor_hint) |
|
||||||
|
|
||||||
|
`chars`
|
||||||
|
Stores the character set used for the scramble effect.
|
||||||
|
|
||||||
|
`scrambling`
|
||||||
|
Whether or not the scrambling effect is active.
|
||||||
|
|
||||||
|
`speed`
|
||||||
|
How many times per second the text gets scrambled.
|
||||||
|
|
||||||
|
`duration`
|
||||||
|
How many times to scramble before revealing next character.
|
||||||
|
|
||||||
|
`infinite`
|
||||||
|
Whether or not the scrambling effect is infinite.
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
| Returns | Name |
|
||||||
|
| ------- | ---- |
|
||||||
|
| `void` | `start()` |
|
||||||
|
| `void` | `set_text(text: String)` |
|
||||||
|
| `String` | `get_text()` |
|
||||||
|
|
||||||
|
#### start()
|
||||||
|
start the scrambling. This acts as a setter function for `scrambling`
|
||||||
|
|
||||||
|
#### set_text(text: String)
|
||||||
|
Setter for the `text` of the parent class `Label`
|
||||||
|
|
||||||
|
#### get_text() -> String
|
||||||
|
Getter for the `text` of the parent class `Label`
|
||||||
|
|
11
docs/docs.md
Normal file
11
docs/docs.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
# MiniDemoTools documentation
|
||||||
|
|
||||||
|
MiniDemoTools is a collection of tools for Godot used internally for demo development at Minihakkerit.
|
||||||
|
|
||||||
|
MiniDemoTools supports Godot versions >4.1
|
||||||
|
|
||||||
|
## Custom classes
|
||||||
|
- [Manager](classes/manager.md)
|
||||||
|
- [ScramblingText](classes/scramblingtext.md)
|
||||||
|
- [DynamicSubViewport](classes/dynamicsubviewport.md)
|
Loading…
Reference in a new issue