Skip to content

Commit

Permalink
Fix ExtensionsAPI's new_project() not working, and add a new `new_e…
Browse files Browse the repository at this point in the history
…mpty_project()` method
  • Loading branch information
OverloadedOrama committed Feb 24, 2024
1 parent 03ce5d4 commit 9b43932
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Autoload/ExtensionsApi.gd
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,9 @@ class ProjectAPI:
## Creates a new project (with new tab) with name [param name], size [param size],
## fill color [param fill_color] and frames [param frames]. The created project also
## gets returned.[br][br]
## [param frames] is an [Array] of type Frames. Usually it can be left as [code][][/code].
## [param frames] is an [Array] of type [Frame]. Usually it can be left as [code][][/code].
func new_project(
frames := [],
frames: Array[Frame] = [],
name := tr("untitled"),
size := Vector2(64, 64),
fill_color := Color.TRANSPARENT
Expand All @@ -551,6 +551,12 @@ class ProjectAPI:
Global.projects.append(new_proj)
return new_proj

## Creates and returns a new [Project], with an optional [param name].
func new_empty_project(name := tr("untitled")) -> Project:
var new_proj := Project.new([], name)
Global.projects.append(new_proj)
return new_proj

## Returns a dictionary containing all the project information.
func get_project_info(project: Project) -> Dictionary:
return project.serialize()
Expand Down

0 comments on commit 9b43932

Please sign in to comment.