mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 09:09:47 +00:00
Fix typos and stuff (#1099)
This commit is contained in:
parent
9cac98c941
commit
fa9536ce4a
|
@ -162,14 +162,17 @@ class GeneralAPI:
|
||||||
func get_canvas() -> Canvas:
|
func get_canvas() -> Canvas:
|
||||||
return Global.canvas
|
return Global.canvas
|
||||||
|
|
||||||
|
## Returns a new ValueSlider. Useful for editing floating values
|
||||||
func create_value_slider() -> ValueSlider:
|
func create_value_slider() -> ValueSlider:
|
||||||
return ValueSlider.new()
|
return ValueSlider.new()
|
||||||
|
|
||||||
|
## Returns a new ValueSliderV2. Useful for editing 2D vectors.
|
||||||
func create_value_slider_v2() -> ValueSliderV2:
|
func create_value_slider_v2() -> ValueSliderV2:
|
||||||
return ValueSliderV2.new()
|
return preload("res://src/UI/Nodes/ValueSliderV2.tscn").instantiate()
|
||||||
|
|
||||||
|
## Returns a new ValueSliderV3. Useful for editing 3D vectors.
|
||||||
func create_value_slider_v3() -> ValueSliderV3:
|
func create_value_slider_v3() -> ValueSliderV3:
|
||||||
return ValueSliderV3.new()
|
return preload("res://src/UI/Nodes/ValueSliderV3.tscn").instantiate()
|
||||||
|
|
||||||
|
|
||||||
## Gives ability to add/remove items from menus in the top bar.
|
## Gives ability to add/remove items from menus in the top bar.
|
||||||
|
@ -238,7 +241,7 @@ class DialogAPI:
|
||||||
func get_dialogs_parent_node() -> Node:
|
func get_dialogs_parent_node() -> Node:
|
||||||
return Global.control.get_node("Dialogs")
|
return Global.control.get_node("Dialogs")
|
||||||
|
|
||||||
## Tells pixelorama that some dialog is about to open or close.
|
## Informs Pixelorama that some dialog is about to open or close.
|
||||||
func dialog_open(open: bool) -> void:
|
func dialog_open(open: bool) -> void:
|
||||||
Global.dialog_open(open)
|
Global.dialog_open(open)
|
||||||
|
|
||||||
|
@ -255,7 +258,7 @@ class PanelAPI:
|
||||||
return dockable.tabs_visible
|
return dockable.tabs_visible
|
||||||
|
|
||||||
## Adds the [param node] as a tab. Initially it's placed on the same panel as the tools tab,
|
## Adds the [param node] as a tab. Initially it's placed on the same panel as the tools tab,
|
||||||
## but can be changed through adding custom layouts.
|
## but it's position can be changed through editing a layout.
|
||||||
func add_node_as_tab(node: Node) -> void:
|
func add_node_as_tab(node: Node) -> void:
|
||||||
var dockable := _get_dockable_container_ui()
|
var dockable := _get_dockable_container_ui()
|
||||||
var top_menu_container := Global.top_menu_container
|
var top_menu_container := Global.top_menu_container
|
||||||
|
@ -401,7 +404,7 @@ class ThemeAPI:
|
||||||
push_error("No theme found at index: ", idx)
|
push_error("No theme found at index: ", idx)
|
||||||
return false
|
return false
|
||||||
|
|
||||||
## Remove the [param theme] from preferences.
|
## Removes the [param theme] from preferences.
|
||||||
func remove_theme(theme: Theme) -> void:
|
func remove_theme(theme: Theme) -> void:
|
||||||
Themes.remove_theme(theme)
|
Themes.remove_theme(theme)
|
||||||
ExtensionsApi.remove_action("ThemeAPI", "add_theme")
|
ExtensionsApi.remove_action("ThemeAPI", "add_theme")
|
||||||
|
@ -417,9 +420,9 @@ class ToolAPI:
|
||||||
## on [param layer_types] defined by [constant LayerTypes],
|
## on [param layer_types] defined by [constant LayerTypes],
|
||||||
## [param extra_hint] (text that appears when mouse havers tool icon), primary shortcut
|
## [param extra_hint] (text that appears when mouse havers tool icon), primary shortcut
|
||||||
## name [param shortcut] and any extra shortcuts [param extra_shortcuts].
|
## name [param shortcut] and any extra shortcuts [param extra_shortcuts].
|
||||||
## [br][br]At the moment extensions can't make their own shortcuts so you can ignore
|
## [br][br]At the moment extensions can't make their own shortcuts so you can leave
|
||||||
## [param shortcut] and [param extra_shortcuts].
|
## [param shortcut] and [param extra_shortcuts] as [code][][/code].
|
||||||
## [br] to determine the position of tool in tool list, use [param insert_point]
|
## [br] To determine the position of tool in tool list, use [param insert_point]
|
||||||
## (if you leave it empty then the added tool will be placed at bottom)
|
## (if you leave it empty then the added tool will be placed at bottom)
|
||||||
func add_tool(
|
func add_tool(
|
||||||
tool_name: String,
|
tool_name: String,
|
||||||
|
@ -472,7 +475,7 @@ class SelectionAPI:
|
||||||
## Moves a selection to [param destination],
|
## Moves a selection to [param destination],
|
||||||
## with content if [param with_content] is [code]true[/code].
|
## with content if [param with_content] is [code]true[/code].
|
||||||
## If [param transform_standby] is [code]true[/code] then the transformation will not be
|
## If [param transform_standby] is [code]true[/code] then the transformation will not be
|
||||||
## applied immediatelyunless [kbd]Enter[/kbd] is pressed.
|
## applied immediately unless [kbd]Enter[/kbd] is pressed.
|
||||||
func move_selection(
|
func move_selection(
|
||||||
destination: Vector2i, with_content := true, transform_standby := false
|
destination: Vector2i, with_content := true, transform_standby := false
|
||||||
) -> void:
|
) -> void:
|
||||||
|
@ -527,14 +530,14 @@ class SelectionAPI:
|
||||||
func paste(in_place := false) -> void:
|
func paste(in_place := false) -> void:
|
||||||
Global.canvas.selection.paste(in_place)
|
Global.canvas.selection.paste(in_place)
|
||||||
|
|
||||||
## Deletes the drawing on current cel enclosed within the selection's area.
|
## Erases the drawing on current cel enclosed within the selection's area.
|
||||||
func delete_content(selected_cels := true) -> void:
|
func delete_content(selected_cels := true) -> void:
|
||||||
Global.canvas.selection.delete(selected_cels)
|
Global.canvas.selection.delete(selected_cels)
|
||||||
|
|
||||||
|
|
||||||
## Gives access to basic project manipulation functions.
|
## Gives access to basic project manipulation functions.
|
||||||
class ProjectAPI:
|
class ProjectAPI:
|
||||||
## The project currently in focus
|
## The project currently in focus.
|
||||||
var current_project: Project:
|
var current_project: Project:
|
||||||
set(value):
|
set(value):
|
||||||
Global.tabs.current_tab = Global.projects.find(value)
|
Global.tabs.current_tab = Global.projects.find(value)
|
||||||
|
@ -575,9 +578,9 @@ class ProjectAPI:
|
||||||
func get_project_info(project: Project) -> Dictionary:
|
func get_project_info(project: Project) -> Dictionary:
|
||||||
return project.serialize()
|
return project.serialize()
|
||||||
|
|
||||||
## Selects the cels and makes the last entry of [param selected_array] as the current cel
|
## Selects the cels and makes the last entry of [param selected_array] as the current cel.
|
||||||
## [param selected_array] is an [Array] of [Arrays] of 2 integers (frame & layer).[br]
|
## [param selected_array] is an [Array] of [Arrays] of 2 integers (frame & layer respectively).
|
||||||
## Frames are counted from left to right, layers are counted from bottom to top.
|
## [br]Frames are counted from left to right, layers are counted from bottom to top.
|
||||||
## Frames/layers start at "0" and end at [param project.frames.size() - 1] and
|
## Frames/layers start at "0" and end at [param project.frames.size() - 1] and
|
||||||
## [param project.layers.size() - 1] respectively.
|
## [param project.layers.size() - 1] respectively.
|
||||||
func select_cels(selected_array := [[0, 0]]) -> void:
|
func select_cels(selected_array := [[0, 0]]) -> void:
|
||||||
|
@ -664,7 +667,8 @@ class ExportAPI:
|
||||||
## (Note: [code]processed_images[/code] is an array of ProcessedImage resource which further
|
## (Note: [code]processed_images[/code] is an array of ProcessedImage resource which further
|
||||||
## has parameters [param image] and [param duration])[br]
|
## has parameters [param image] and [param duration])[br]
|
||||||
## If the value of [param tab] is not in [constant ExportTab] then the format will be added to
|
## If the value of [param tab] is not in [constant ExportTab] then the format will be added to
|
||||||
## both tabs. Returns the index of exporter, which can be used to remove exporter later.
|
## both tabs.
|
||||||
|
## [br]Returns the index of exporter, which can be used to remove exporter later.
|
||||||
func add_export_option(
|
func add_export_option(
|
||||||
format_info: Dictionary,
|
format_info: Dictionary,
|
||||||
exporter_generator: Object,
|
exporter_generator: Object,
|
||||||
|
@ -704,17 +708,17 @@ class ExportAPI:
|
||||||
## Gives access to adding custom import options.
|
## Gives access to adding custom import options.
|
||||||
class ImportAPI:
|
class ImportAPI:
|
||||||
## [param import_scene] is a scene preload that will be instanced and added to "import options"
|
## [param import_scene] is a scene preload that will be instanced and added to "import options"
|
||||||
## section of pixelorama's import dialogs and will appears whenever [param import_name] is
|
## section of pixelorama's import dialogs and will appear whenever [param import_name] is
|
||||||
## chosen from import menu.
|
## chosen from import menu.
|
||||||
## [br]
|
## [br]
|
||||||
## [param import_scene] must have a a script containing:[br]
|
## [param import_scene] must have a script containing:[br]
|
||||||
## 1. An optional variable named [code]import_preview_dialog[/code] of type [ConfirmationDialog],
|
## 1. An optional variable named [code]import_preview_dialog[/code] of type [ConfirmationDialog],
|
||||||
## If present, it will automatically be assigned a reference to the relevant import dialog's
|
## If present, it will automatically be assigned a reference to the relevant import dialog's
|
||||||
## [code]ImportPreviewDialog[/code] class so that you can easily access variables and
|
## [code]ImportPreviewDialog[/code] class so that you can easily access variables and
|
||||||
## methods of that class. (This variable is meant to be read-only)[br]
|
## methods of that class. (This variable is meant to be read-only)[br]
|
||||||
## 2. The method [method initiate_import] which takes 2 arguments: [code]path[/code],
|
## 2. The method [method initiate_import], which takes 2 arguments: [code]path[/code],
|
||||||
## [code]image[/code], which are automatically passed to [method initiate_import] at
|
## [code]image[/code]. Values will automatically be passed to these arguments at the
|
||||||
## time of import.
|
## time of import.[br]Returns the id of the importer.
|
||||||
func add_import_option(import_name: StringName, import_scene_preload: PackedScene) -> int:
|
func add_import_option(import_name: StringName, import_scene_preload: PackedScene) -> int:
|
||||||
var id := OpenSave.add_import_option(import_name, import_scene_preload)
|
var id := OpenSave.add_import_option(import_name, import_scene_preload)
|
||||||
ExtensionsApi.add_action("ImportAPI", "add_import_option")
|
ExtensionsApi.add_action("ImportAPI", "add_import_option")
|
||||||
|
@ -728,11 +732,11 @@ class ImportAPI:
|
||||||
ExtensionsApi.remove_action("ImportAPI", "add_import_option")
|
ExtensionsApi.remove_action("ImportAPI", "add_import_option")
|
||||||
|
|
||||||
|
|
||||||
## Gives access to palettes.
|
## Gives access to palette related stuff.
|
||||||
class PaletteAPI:
|
class PaletteAPI:
|
||||||
## Creates and adds a new [Palette] with name [param palette_name] with [param data]
|
## Creates and adds a new [Palette] with name [param palette_name] containing [param data].
|
||||||
## in the form of a [Dictionary].
|
## [param data] is a [Dictionary] containing the palette information.
|
||||||
## An example of [code]data[/code] dictionary will be:[codeblock]
|
## An example of [code]data[/code] will be:[codeblock]
|
||||||
## {
|
## {
|
||||||
## "colors": [
|
## "colors": [
|
||||||
## {
|
## {
|
||||||
|
@ -811,7 +815,8 @@ class SignalsAPI:
|
||||||
# PROJECT RELATED SIGNALS
|
# PROJECT RELATED SIGNALS
|
||||||
## Connects/disconnects a signal to [param callable], that emits
|
## Connects/disconnects a signal to [param callable], that emits
|
||||||
## whenever a new project is created.[br]
|
## whenever a new project is created.[br]
|
||||||
## [b]Binds: [/b]It has one bind of type [code]Project[/code] which is the newly created project
|
## [b]Binds: [/b]It has one bind of type [code]Project[/code] which is the newly
|
||||||
|
## created project.
|
||||||
func signal_project_created(callable: Callable, is_disconnecting := false) -> void:
|
func signal_project_created(callable: Callable, is_disconnecting := false) -> void:
|
||||||
_connect_disconnect(Global.project_created, callable, is_disconnecting)
|
_connect_disconnect(Global.project_created, callable, is_disconnecting)
|
||||||
|
|
||||||
|
@ -867,7 +872,7 @@ class SignalsAPI:
|
||||||
## Connects/disconnects a signal to [param callable], that emits
|
## Connects/disconnects a signal to [param callable], that emits
|
||||||
## whenever preview is about to be drawn.[br]
|
## whenever preview is about to be drawn.[br]
|
||||||
## [b]Binds: [/b]It has one bind of type [Dictionary] with keys: [code]exporter_id[/code],
|
## [b]Binds: [/b]It has one bind of type [Dictionary] with keys: [code]exporter_id[/code],
|
||||||
## [code]export_tab[/code], [code]preview_images[/code], [code]durations[/code]
|
## [code]export_tab[/code], [code]preview_images[/code], [code]durations[/code].[br]
|
||||||
## [br] Use this if you plan on changing preview of export
|
## Use this if you plan on changing preview of export.
|
||||||
func signal_export_about_to_preview(callable: Callable, is_disconnecting := false) -> void:
|
func signal_export_about_to_preview(callable: Callable, is_disconnecting := false) -> void:
|
||||||
_connect_disconnect(Global.export_dialog.about_to_preview, callable, is_disconnecting)
|
_connect_disconnect(Global.export_dialog.about_to_preview, callable, is_disconnecting)
|
||||||
|
|
Loading…
Reference in a new issue