Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
9b3d9ce95b |
7 changed files with 6 additions and 140 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,6 @@
|
|||
target/
|
||||
*.import
|
||||
Cargo.lock
|
||||
*.dll
|
||||
*.so
|
||||
*.d
|
|
@ -6,8 +6,8 @@ reloadable = true
|
|||
[libraries]
|
||||
linux.debug.x86_64 = "res://addons/MiniDemoTools/librust.so"
|
||||
linux.release.x86_64 = "res://addons/MiniDemoTools/librust.so"
|
||||
##windows.debug.x86_64 = "res://../rust/target/debug/librust.dll"
|
||||
##windows.release.x86_64 = "res://../rust/target/release/librust.dll"
|
||||
windows.debug.x86_64 = "res://addons/MiniDemoTools/rust.dll"
|
||||
windows.release.x86_64 = "res://addons/MiniDemoTools/rust.dll"
|
||||
|
||||
|
||||
[icons]
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
# DynamicSubViewport
|
||||
`inherits SubViewport`
|
||||
|
||||
### Usage
|
||||
This class functions identically to the `SubViewport` class, except it scales automatically to the root viewport.
|
|
@ -1,72 +0,0 @@
|
|||
|
||||
# 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.
|
Binary file not shown.
Before Width: | Height: | Size: 1.5 MiB |
|
@ -1,49 +0,0 @@
|
|||
# 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
11
docs/docs.md
|
@ -1,11 +0,0 @@
|
|||
|
||||
# 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