Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Array[ArrayMesh] get_meshes()
| `Rect2` | [`region_rect`](#rect2-region_rect--rect20-0-0-0) | `Rect2(0, 0, 0, 0)` |
| `Texture2D` | [`texture`](#texture2d-texture) | |
| `float` | [`uv_correction`](#float-uv_correction--00) | `0.0` |
| `float` | [`editor_delay`](#float-editor_delay--10) | `1.0` |
| `int` | [`vframes`](#int-vframes--1) | `1` |

### Methods
Expand Down Expand Up @@ -288,6 +289,16 @@ void set_uv_correction(float uv_correction)
float get_uv_correction()
```

#### `float editor_delay = 1.0`

The number of seconds before the editor generates the sprite mesh.

```gdscript
void set_editor_delay(float editor_delay)

float get_editor_delay()
```

#### `int vframes = 1`

The number of rows in the sprite sheet.
Expand Down
4 changes: 3 additions & 1 deletion demo/addons/sprite_mesh/sprite_mesh_instance.gd
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ const GreedyAlgorithm = preload("./scripts/greedy_algorithm.gd")
## This property aims to fix this problem. When its value increases, the UV mapping would move
## inwards. Be careful, as it would also produce misalignment.
@export_range(0, 1) var uv_correction := 0.0: set = set_uv_correction
## The number of seconds before the editor generates the sprite mesh.
@export var editor_delay := 1.0

@export_group("Generated SpriteMesh")
## The result of the algorithm. It would generate automatically in the editor, or after calling
Expand Down Expand Up @@ -104,7 +106,7 @@ func _request_update() -> void:
_pending_update = true

if Engine.is_editor_hint():
_seconds_left = 1
_seconds_left = editor_delay


func _generate_sprite_mesh() -> SpriteMesh:
Expand Down