Add ESCAnimationResource to hold characters animations. (#342)

Co-authored-by: StraToN <StraToN@users.noreply.github.com>
Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
Co-authored-by: dploeger <dploeger@users.noreply.github.com>
This commit is contained in:
Julian Murgia
2021-08-03 17:48:55 +02:00
committed by GitHub
parent 56bf96da8c
commit 392dc2d607
15 changed files with 553 additions and 207 deletions

View File

@@ -0,0 +1,27 @@
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
# ESCAnimationName
**Extends:** [Resource](../Resource)
## Description
Class defining an animation to use for an angle.
## Property Descriptions
### animation
```gdscript
export var animation: String = ""
```
Name of the animation
### mirrored
```gdscript
export var mirrored: bool = false
```
Animation mirror (false is no mirror, true is mirrored)

View File

@@ -0,0 +1,54 @@
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
# ESCAnimationResource
**Extends:** [Resource](../Resource)
## Description
Resource containing all defined animations and angles for
characters movement.
## Property Descriptions
### dir\_angles
```gdscript
var dir_angles: Array
```
Array containing the different angles available for animations.
Each angle is defined by an array [start_angle, angle_size].
start_angle must be between 0 and 360.
Angle 0 and 360 are the same and correspond to UP/NORTH
90 is RIGHT/EAST, 180 is DOWN/SOUTH, etc
### directions
```gdscript
var directions: Array
```
Array of animations for each direction, from UP to RIGHT_UP clockwise
[animation_name, scale]: scale parameter can be set to -1 to mirror
the animation
### idles
```gdscript
var idles: Array
```
Array containing the idle animations for each direction (in the
order defined by dir_angles): scale parameter can be set to -1 to mirror
the animation
### speaks
```gdscript
var speaks: Array
```
Array containing the speak animations for each direction (in the
order defined by dir_angles): scale parameter can be set to -1 to mirror
the animation

View File

@@ -0,0 +1,27 @@
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
# ESCDirectionAngle
**Extends:** [Resource](../Resource)
## Description
 Class defining an angle, with a start angle (between 0 and 360) and a size.
## Property Descriptions
### angle\_start
```gdscript
export var angle_start: int = 0
```
Start angle of the directional angle.
### angle\_size
```gdscript
export var angle_size: int = 0
```
Size of the angle

View File

@@ -191,10 +191,10 @@ Speed damp of this item if movable
### animations
```gdscript
export var animations = "[Object:null]"
var animations: ESCAnimationResource
```
 Animations script (for walking, idling...)
 ESCAnimationsResource (for walking, idling...)
### animation\_sprite

View File

@@ -13,7 +13,7 @@ Logging framework for Escoria
### LOG\_DEBUG
```gdscript
const LOG_WARNING: int = 1
const LOG_DEBUG: int = 3
```
Valid log levels
@@ -21,7 +21,7 @@ Valid log levels
### LOG\_ERROR
```gdscript
const LOG_WARNING: int = 1
const LOG_DEBUG: int = 3
```
Valid log levels
@@ -29,7 +29,7 @@ Valid log levels
### LOG\_INFO
```gdscript
const LOG_WARNING: int = 1
const LOG_DEBUG: int = 3
```
Valid log levels
@@ -37,7 +37,7 @@ Valid log levels
### LOG\_WARNING
```gdscript
const LOG_WARNING: int = 1
const LOG_DEBUG: int = 3
```
Valid log levels

View File

@@ -178,7 +178,7 @@ Update the sprite scale and lighting
### is\_angle\_in\_interval
```gdscript
func is_angle_in_interval(angle: float, interval: Array) -> bool
func is_angle_in_interval(angle: float, direction_angle: ESCDirectionAngle) -> bool
```
Returns true if given angle is inside the interval given by a starting_angle
@@ -187,9 +187,9 @@ and the size.
#### Parameters
- angle: Angle to test
- interval: Array of size 2, containing the starting angle, and the size of
interval
eg: [90, 40] corresponds to angle between 90° and 130°
- direction_angle: ESCDirectionAngle resource, containing the starting angle,
and the size of interval
eg: angle_start=90, angle_size=40 corresponds to angle between 90° and 130°
### set\_angle