Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typos and comas #96

Merged
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
7 changes: 3 additions & 4 deletions docs/extension_system/extension_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ func _exit_tree() -> void: # Extension is being uninstalled or disabled
```

## Exporting the Extension
:::info Export Templates
Downloading/Installing export templates is not required for `.pck` export.
:::

Now that you have the basic extension code ready, let's export it;
1. From the top bar in Godot editor go to **Project > Export** and choose any platform option (the extension should work on other platforms regardless of which platform you choose).
Expand All @@ -103,10 +106,6 @@ Now that you have the basic extension code ready, let's export it;

3. After that, press <kbd>Export PCK/Zip</kbd> and export it as a PCK file (both Zip and PCK extensions are recognized by Pixelorama but PCK is recommended). The name of exported pck should be the same as the `name` of your extension, in this case it should be `Example.pck`

:::tip
You don't have to install export templates for the `.pck` export.
:::

## Installing the Extension

To install an extension, from Pixelorama's top menu go to **Edit > Preferences > Extensions** and click <kbd>Add Extension</kbd>.
Expand Down
32 changes: 18 additions & 14 deletions docs/extension_system/extensions_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ This is the documentation for Api version 5
:::

### Description
This Api gives you the essentials to develop a working extension for Pixelorama.
The Api consists of many smaller Apis, each giving access to different areas of the Software;
This Api gives you the essentials to develop a working extension for Pixelorama. To keep things organized, the Api is divided into
many smaller Apis, each giving access to different areas of the Software;

To access this anywhere in the extension use `get_node_or_null("/root/ExtensionsApi")`
To access this anywhere in the extension use `get_node_or_null("/root/ExtensionsApi")` e.g.
```
var api = get_node_or_null("/root/ExtensionsApi")
```

:::tip
Keep in mind that this API is targeted towards users who are not fully familiar with Pixelorama's source code. If you need to do something more complicated and more low-level, you would need to interact directly with the source code.
Expand Down Expand Up @@ -41,13 +44,13 @@ Keep in mind that this API is targeted towards users who are not fully familiar
- **Array[Node]** `get_main_nodes(extension_name: StringName)`

- Returns the initial nodes of an extension named `extension_name`. initial nodes are the nodes whose paths are in the `nodes` key of an extension.json file.
An extensions can be made to communicate with each other using this method.
Extensions can be made to communicate with each other using this method.


GeneralAPI
---
### Description
This part of Api provides stuff like commonly used Autoloads, App's version info etc the most basic (but important) stuff.
This part of Api provides the general stuff, like commonly used Autoloads, App's version info etc. The most basic (but important) stuff.

### Method Descriptions

Expand All @@ -57,20 +60,21 @@ This part of Api provides stuff like commonly used Autoloads, App's version info

- **ConfigFile** `get_config_file()`

- Returns the `ConfigFile` contains all the settings (Brushes, sizes, preferences, etc...).
- Returns the `ConfigFile` containing all Pixelorama settings (e.g. Brushes, sizes, preferences, etc...).

- **"src/Autoload/Global.gd"** `get_global()`

- Returns the Global autoload used by Pixelorama.
Contains references to almost all UI Elements, Variables that indicate different settings etc..., In short it is the most important autoload of Pixelorama.
- Returns the **Global** autoload used by Pixelorama.
Contains references to almost all UI Elements, Variables that indicate different settings etc...,
In short it is the most important autoload of Pixelorama.

- **"src/Autoload/DrawingAlgos.gd"** `get_drawing_algos()`

- Returns the DrawingAlgos autoload, contains different drawing algorithms used by Pixelorama.
- Returns the **DrawingAlgos** autoload, contains different drawing algorithms used by Pixelorama.

- **ShaderImageEffect** `get_shader_image_effect()`

- Gives you a new ShaderImageEffect class. this class can apply shader to an image.
- Gives you a new `ShaderImageEffect` class. this class can apply shader to an image.
It contains method: `generate_image(img: Image, shader: Shader, params: Dictionary, size: Vector2)`
Whose parameters are identified as:

Expand All @@ -91,15 +95,15 @@ Whose parameters are identified as:

- **ValueSlider** `create_value_slider()`

- Returns a new ValueSlider. Useful for editing floating values.
- Returns a new `ValueSlider`. Useful for editing floating values.

- **ValueSliderV2** `create_value_slider_v2()`

- Returns a new ValueSliderV2. Useful for editing 2D vectors.
- Returns a new `ValueSliderV2`. Useful for editing 2D vectors.

- **ValueSliderV3** `create_value_slider_v3()`

- Returns a new ValueSliderV3. Useful for editing 3D vectors.
- Returns a new `ValueSliderV3`. Useful for editing 3D vectors.


MenuAPI
Expand All @@ -123,7 +127,7 @@ Gives ability to add/remove items from menus in the top bar.
- **int** `add_menu_item(menu_type: int, item_name: String, item_metadata: Variant, item_id := -1)`

- Adds a menu item of title `item_name` to the `menu_type` defined by `@unnamed_enums`.
`item_metadata` is usually a window node you want to appear when you click the `item_name`. That window node should also have a `menu_item_clicked` function inside its script.
`item_metadata` is usually a window node you want to appear when you click the `item_name`. That window node should also have a `menu_item_clicked() -> void` function inside its script.
Index of the added item is returned (which can be used to remove menu item later on).

- **void** `remove_menu_item(menu_type: int, item_idx: int)`
Expand Down
4 changes: 2 additions & 2 deletions docs/extension_system/internal_extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ The concept of internal extensions was origally targeted towards potentially mak

## Making an Extension, internal
:::tip version control
To ensure your work isn't accidentally lost, it is highly recommended that also use version control (e.g Git) in your extension project and in pixelorama's source.
To ensure your work isn't accidentally lost, it is highly recommended that you use version control (e.g Git) in your extension project and in pixelorama's source.
:::

1. First, make an extension project by following [this tutorial](./extension_basics#making-an-extension) (from here, it will now be referred to as **your project**).
2. Get and unzip the [source code](https://github.com/Orama-Interactive/Pixelorama/releases) of pixelorama that you intend to use for your extension.
3. Create an `Extensions` folder (case sensitive) in the pixelorama's source code in the `src` folder.
4. from your project, copy (not cut/move) the contents from `src/Extensions` folder to the `src/Extensions` folder in pixelorama (created in step 3).
4. From your project, copy (not cut/move) the contents from `src/Extensions` folder to the `src/Extensions` folder in pixelorama (created in step 3).
5. Navigate to the `src/Extensions/(extension name)/extension.json` file and copy the value of the `name` key. Then open `src/HandleExtensions.gd` file in pixelorama's source and find the `_add_internal_extensions()` method. Modify and save it as follows:
```
func _add_internal_extensions() -> void:
Expand Down
Loading