feat: This enables user-defined transition and uses a tween to animate the transitions (#405)
* feat: This enables user-defined transition and uses a tween to animate the transitions fixes #344 * docs: Automatic update of API docs * docs: Automatic update of API docs Co-authored-by: Dennis Ploeger <develop@dieploegers.de> Co-authored-by: dploeger <dploeger@users.noreply.github.com>
This commit is contained in:
@@ -349,7 +349,7 @@ Return the sprite node
|
||||
### set\_angle
|
||||
|
||||
```gdscript
|
||||
func set_angle(deg: int, immediate = true)
|
||||
func set_angle(deg: int, wait: float = 0)
|
||||
```
|
||||
|
||||
Set the angle
|
||||
@@ -357,13 +357,12 @@ Set the angle
|
||||
#### Parameters
|
||||
|
||||
- deg: The angle degree to set
|
||||
- immediate: Set the angle immediately. If false will show intermediate
|
||||
angles
|
||||
- wait: Wait this amount of seconds until continuing with turning around
|
||||
|
||||
### turn\_to
|
||||
|
||||
```gdscript
|
||||
func turn_to(object: Node, immediate = true)
|
||||
func turn_to(object: Node, wait: float = 0)
|
||||
```
|
||||
|
||||
Turn to face another object
|
||||
@@ -371,8 +370,7 @@ Turn to face another object
|
||||
#### Parameters
|
||||
|
||||
- deg: The angle degree to set
|
||||
- immediate: Set the angle immediately. If false will show intermediate
|
||||
angles
|
||||
- float Wait this amount of seconds until continuing with turning around
|
||||
|
||||
### start\_talking
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ Update the sprite scale and lighting
|
||||
### set\_angle
|
||||
|
||||
```gdscript
|
||||
func set_angle(deg: int, immediate = true) -> var
|
||||
func set_angle(deg: int, wait: float = 0) -> var
|
||||
```
|
||||
|
||||
Sets character's angle and plays according animation.
|
||||
@@ -178,14 +178,12 @@ Sets character's angle and plays according animation.
|
||||
#### Parameters
|
||||
|
||||
- deg int angle to set the character
|
||||
- immediate
|
||||
If true, direction is switched immediately. Else, successive
|
||||
animations are used so that the character turns to target angle.
|
||||
- wait float Wait this amount of seconds until continuing with turning around
|
||||
|
||||
### turn\_to
|
||||
|
||||
```gdscript
|
||||
func turn_to(item: Node, immediate = true) -> void
|
||||
func turn_to(item: Node, wait: float = 0) -> void
|
||||
```
|
||||
|
||||
Turns the character to face another item or character.
|
||||
@@ -193,9 +191,7 @@ Turns the character to face another item or character.
|
||||
#### Parameters
|
||||
|
||||
- item_id id of the object to face.
|
||||
- immediate
|
||||
If true, direction is switched immediately. Else, successive
|
||||
animations are used so that the character turns to target angle.
|
||||
- float Wait this amount of seconds until continuing with turning around
|
||||
|
||||
### get\_shortest\_way\_to\_dir
|
||||
|
||||
|
||||
60
docs/api/ESCTransitionPlayer.md
Normal file
60
docs/api/ESCTransitionPlayer.md
Normal file
@@ -0,0 +1,60 @@
|
||||
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
|
||||
|
||||
# ESCTransitionPlayer
|
||||
|
||||
**Extends:** [ColorRect](../ColorRect)
|
||||
|
||||
## Description
|
||||
|
||||
A transition player for scene changes
|
||||
|
||||
## Enumerations
|
||||
|
||||
### TRANSITION\_MODE
|
||||
|
||||
```gdscript
|
||||
const TRANSITION_MODE: Dictionary = {"IN":0,"OUT":1}
|
||||
```
|
||||
|
||||
The valid transition modes
|
||||
|
||||
## Method Descriptions
|
||||
|
||||
### transition
|
||||
|
||||
```gdscript
|
||||
func transition(transition_name: String = "", mode: int, duration: float = 1) -> void
|
||||
```
|
||||
|
||||
### get\_transition
|
||||
|
||||
```gdscript
|
||||
func get_transition(name: String) -> String
|
||||
```
|
||||
|
||||
Returns the full path for a transition shader based on its name
|
||||
|
||||
## Parameters
|
||||
|
||||
- name: The name of the transition to test
|
||||
|
||||
*Returns* the full path to the shader or an empty string, if it can't be found
|
||||
|
||||
### has\_transition
|
||||
|
||||
```gdscript
|
||||
func has_transition(name: String) -> bool
|
||||
```
|
||||
|
||||
Returns true whether the transition scene has a transition corresponding
|
||||
to name provided.
|
||||
|
||||
## Parameters
|
||||
|
||||
- name: The name of the transition to test
|
||||
|
||||
*Returns* true if a transition exists with given name.
|
||||
|
||||
## Signals
|
||||
|
||||
- signal transition_done(): Emitted when the transition was played
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
## Description
|
||||
|
||||
`set_angle object degrees [immediate]`
|
||||
`set_angle object degrees [wait]`
|
||||
|
||||
Turns object to a degrees angle without animations. 0 sets object facing
|
||||
forward, 90 sets it 90 degrees clockwise ("east") etc. When turning to the
|
||||
@@ -15,6 +15,9 @@ destination angle, animations are played if they're defined in animations.
|
||||
object must be player or interactive. degrees must be between [0, 360] or an
|
||||
error is reported.
|
||||
|
||||
The wait parameter sets how long to wait for each intermediate angle. It
|
||||
defaults to 0, meaning the turnaround is immediate.
|
||||
|
||||
@ESC
|
||||
|
||||
## Method Descriptions
|
||||
|
||||
@@ -6,10 +6,16 @@
|
||||
|
||||
## Description
|
||||
|
||||
`transition transition_name in|out`
|
||||
`transition transition_name in|out [delay]`
|
||||
|
||||
Performs a transition in our out manually.
|
||||
|
||||
Parameters:
|
||||
- transition_name: Name of the transition shader from one of the transition
|
||||
directories
|
||||
- in|out: Wether to play the transition in IN- or OUT-mode
|
||||
- delay: Delay for the transition to take. Defaults to 1 second
|
||||
|
||||
@ESC
|
||||
|
||||
## Method Descriptions
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
## Description
|
||||
|
||||
`turn_to object object_to_face [immediate]`
|
||||
`turn_to object object_to_face [wait]`
|
||||
|
||||
Turns object to face another object.
|
||||
|
||||
Set immediate to true to show directly switch to the direction and not
|
||||
show intermediate angles
|
||||
The wait parameter sets how long to wait for each intermediate angle. It
|
||||
defaults to 0, meaning the turnaround is immediate.
|
||||
|
||||
@ESC
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ The Escoria context currently in wait state
|
||||
### scene\_transition
|
||||
|
||||
```gdscript
|
||||
var scene_transition
|
||||
var scene_transition: ESCTransitionPlayer
|
||||
```
|
||||
|
||||
Reference to the scene transition node
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
|
||||
|
||||
# transition.gd
|
||||
|
||||
**Extends:** [ColorRect](../ColorRect)
|
||||
|
||||
## Description
|
||||
|
||||
A transition player for scene changes
|
||||
|
||||
## Property Descriptions
|
||||
|
||||
### transition\_name
|
||||
|
||||
```gdscript
|
||||
export var transition_name: String = ""
|
||||
```
|
||||
|
||||
## Method Descriptions
|
||||
|
||||
### transition\_out
|
||||
|
||||
```gdscript
|
||||
func transition_out(p_transition_name: String = "") -> var
|
||||
```
|
||||
|
||||
Transition out
|
||||
|
||||
## Parameters
|
||||
|
||||
- p_transition_name: name of the transition to play (if empty string, uses
|
||||
the default transition)
|
||||
|
||||
### transition\_in
|
||||
|
||||
```gdscript
|
||||
func transition_in(p_transition_name: String = "") -> var
|
||||
```
|
||||
|
||||
Transition in
|
||||
|
||||
## Parameters
|
||||
|
||||
- p_transition_name: name of the transition to play (if empty string, uses
|
||||
the default transition)
|
||||
|
||||
### has\_transition
|
||||
|
||||
```gdscript
|
||||
func has_transition(p_name: String) -> bool
|
||||
```
|
||||
|
||||
Returns true whether the transition scene has a transition corresponding
|
||||
to name provided.
|
||||
|
||||
## Parameters
|
||||
|
||||
- p_name: The name of the transition to test
|
||||
|
||||
*Returns* true if a transition exists with given name.
|
||||
|
||||
## Signals
|
||||
|
||||
- signal transition_done(): Emitted when the transition was played
|
||||
Reference in New Issue
Block a user