mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Fix ExtensionsAPI's new_project()
not working, and add a new new_empty_project()
method
This commit is contained in:
parent
03ce5d40a2
commit
9b439327b8
|
@ -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
|
||||
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue