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:
Dennis Ploeger
2021-09-28 11:30:40 +02:00
committed by GitHub
parent b710def99d
commit df78b52b8a
28 changed files with 323 additions and 301 deletions

View File

@@ -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

View File

@@ -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

View 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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -277,7 +277,7 @@ event ends.
Changes the "active" state of the object, value can be true or false.
Inactive objects are hidden in the scene.
#### <a name="SetAngleCommand.md"></a>`set_angle object degrees [immediate]` [API-Doc](api/SetAngleCommand.md)
#### <a name="SetAngleCommand.md"></a>`set_angle object degrees [wait]` [API-Doc](api/SetAngleCommand.md)
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
@@ -285,6 +285,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.
#### <a name="SetAnimationsCommand.md"></a>`set_animations object animations` [API-Doc](api/SetAnimationsCommand.md)
Set the animation resource for the given ESCPlayer
@@ -348,15 +351,21 @@ Sets the position of object1 to the position of object2.
#### <a name="TeleportPosCommand.md"></a>`teleport_pos object1 x y` [API-Doc](api/TeleportPosCommand.md)
Sets the position of object1 to the position (x,y).
#### <a name="TransitionCommand.md"></a>`transition transition_name in|out` [API-Doc](api/TransitionCommand.md)
#### <a name="TransitionCommand.md"></a>`transition transition_name in|out [delay]` [API-Doc](api/TransitionCommand.md)
Performs a transition in our out manually.
#### <a name="TurnToCommand.md"></a>`turn_to object object_to_face [immediate]` [API-Doc](api/TurnToCommand.md)
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
#### <a name="TurnToCommand.md"></a>`turn_to object object_to_face [wait]` [API-Doc](api/TurnToCommand.md)
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.
#### <a name="WaitCommand.md"></a>`wait seconds` [API-Doc](api/WaitCommand.md)
Blocks execution of the current script for a number of seconds specified by the "seconds" parameter.