Add lever and jump pad components with activation logic
0
addons/rmsmartshape/documentation/.gdignore
Normal file
47
addons/rmsmartshape/documentation/Controls.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# SmartShape2D - Controls and Hotkeys
|
||||
|
||||
<!-- TODO: Likely, outdated. Should this even be covered in such detail? -->
|
||||
|
||||
## Controls - Point Create
|
||||
|
||||
- Add Point
|
||||
- Left Click Anywhere in the viewport
|
||||
|
||||
- Leave Point Create Mode
|
||||
- ESCAPE
|
||||
|
||||
## Controls - Point Edit
|
||||
|
||||
- Add Point
|
||||
- Either:
|
||||
- Hold ALT and Left Click Anywhere in the viewport
|
||||
- Click on an edge between two points
|
||||
|
||||
- Grab closest point
|
||||
- Hold CTRL
|
||||
|
||||
- Cycle through texture indices of a point
|
||||
- Mouseover a point and MOUSEWHEEL up or down to increment / decrement the texture index
|
||||
|
||||
- Flip texture
|
||||
- Mouseover a point and press SPACE
|
||||
|
||||
- Change texture width property
|
||||
- Mouseover a point, hold SHIFT, then MOUSEWHEEL up or down to increment / decrement the texture width
|
||||
|
||||
- Add Bezier curve
|
||||
- Mouseover a point, hold SHIFT, then click and drag to create control points on the point
|
||||
|
||||
- Create New Shape
|
||||
- Hold SHFT + ALT and click
|
||||
- The location of the click will be the the first point of a newly created Shape Node
|
||||
|
||||
### Overlap
|
||||
|
||||
When multiple points and edges overlap, it can be ambiguous what clicking will do.
|
||||
SmartShape adheres the following rules:
|
||||
- If a control point overlaps a vertex, the control point takes priority
|
||||
- If a control point or vertex overlaps an edge:
|
||||
- Clicking will move the control point or vert
|
||||
- Clicking while holding ALT will create new point on the edge
|
||||
|
47
addons/rmsmartshape/documentation/FAQ.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# SmartShape2D - FAQ
|
||||
|
||||
<!-- TODO: Outdated. -->
|
||||
|
||||
## Why aren't my textures repeating?
|
||||
|
||||
If your textures aren't repeating and look something like this:
|
||||
|
||||

|
||||
|
||||
The issue is most likely that you need to set the texture's import options in Godot:
|
||||
|
||||

|
||||
|
||||
## Why isn't my shape updaing when I change the Light Mask?
|
||||
|
||||
Each shape is currently rendered by multiple-subnodes (Children Node2Ds).
|
||||
Their owner isn't set, making them invisible in the editor (unless you have debug mode on).
|
||||
|
||||
Unfortunately, there is no accessible signal when changing the Light Mask setting in editor.
|
||||
That means changing the Light Mask setting in editor won't trigger the children nodes to change THIER Light Mask
|
||||
|
||||
The Shape nodes CAN update their children's light mask, they just need to be triggered to do it manually.
|
||||
If you update the shape in any way, the shape will update its children's light mask.
|
||||
|
||||
When playing the game, the render Node children are regenerated, ensuring that the light mask will be set
|
||||
correctly.
|
||||
|
||||
The actual shape has set\_light\_mask overloaded, so changing the light\_mask in code should work without issue
|
||||
|
||||
If you need to manually tell the shape to update its rendering, call the set\_as\_dirty() method
|
||||
|
||||
If anyone has any insights on this issue, please feel free to open an issue on this subject
|
||||
and let us know how we might be able to fix it
|
||||
|
||||
## Why does changing the width look so ugly?
|
||||
|
||||
Changing the width of the quads generally looks best with welding turned off.
|
||||
|
||||
If welding is on, you can still change the width of the quads, but you may need to play with it a bit.
|
||||
It's best that you change the width gradually in small increments instead of sharply.
|
||||
Sharply changing the width will result in odd looking shapes.
|
||||
|
||||
[Non-perspective rendering to a non-parallelogram is kinda tough](http://reedbeta.com/blog/quadrilateral-interpolation-part-1/)
|
||||
|
||||
If anyone has any insights on this issue, please feel free to open an issue on this subject
|
||||
and let us know how we might be able to fix it
|
40
addons/rmsmartshape/documentation/Godot4.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Using SmartShape2D with Godot 4
|
||||
|
||||
Godot 4 moved `repeat` for textures as an import option to a per-node option. On how to make textures repeat and
|
||||
set normal maps see [section below.](#repeating-textures-and-normal-textures-with-canvastexture)
|
||||
|
||||
By default, **shape resources are shared** when the shape is copy-pasted. Editing points will edit every copy of that shape.
|
||||
To make point geometry unique, press **"Make Unique"** property button in Geometry property group in the inspector:
|
||||
|
||||

|
||||
|
||||
## Repeating Textures and Normal Textures with CanvasTexture
|
||||
|
||||
CanvasItem, the base class of Node2D has a Texture section with `repeat`. If you aren't using a normal, you can set it here.
|
||||
By default, this setting is inherited by children nodes so you could set it on a parent node (assuming all the children need
|
||||
repeating textures or it's easier to disable for a few specific nodes than turn it on for most).
|
||||
|
||||

|
||||
|
||||
Normal textures are no longer set in a material resource.
|
||||
|
||||
To set normal textures, you can create a `CanvasTexture` resource in the inspector on any property, that allows setting a `Texture2D`.
|
||||
|
||||

|
||||
|
||||
`CanvasTexture` allows you to assign diffuse texture and normal map texture, as well as set textures to `repeat`:
|
||||
|
||||

|
||||
|
||||
## Converting Projects from Godot 3.x
|
||||
|
||||
Scene files with shapes saved in Godot 3.x should load in Godot 4 project. However, you may encounter some issues. Here is a list of expected problems:
|
||||
1. Textures are looking weird, not repeated.
|
||||
2. Normal textures are not used.
|
||||
|
||||
Please read the section on [how to set repeat and use normal textures in Godot 4](#repeating-textures-and-normal-textures-with-canvastexture).
|
||||
|
||||
## Removed Features
|
||||
|
||||
- The Godot 4 version of this addon does not support 1.x RMSmartShape2D nodes anymore.
|
||||
- SS2D_Shape_Meta node was removed, since its functionality is available copy-pasted shapes by default.
|
20
addons/rmsmartshape/documentation/Install.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# SmartShape2D - Install
|
||||
|
||||
## Asset Library
|
||||
|
||||
- After installing the plugin, you may encounter an error, this is normal.
|
||||
- You need to restart Godot before using the plugin.
|
||||
|
||||
## Manual Install
|
||||
|
||||
- Clone the repository at https://github.com/SirRamEsq/SmartShape2D.
|
||||
- Move the "addons/rmsmartshape" folder to your project's "addons" folder.
|
||||
- Open your project in Godot to have the addon install.
|
||||
- After installing the plugin, you may encounter an error, this is normal.
|
||||
- Restart Godot.
|
||||
|
||||
## Activate Plugin
|
||||
|
||||
- After Installing the plugin, activate the plugin by navigating to `Project -> Project Settings... -> Plugins`
|
||||
|
||||

|
60
addons/rmsmartshape/documentation/Normals.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# Normals
|
||||
|
||||
## Default Normals
|
||||
|
||||
Even if you assign normal textures to your Edge Material, the normals will look wrong.
|
||||
|
||||
For example, consider the following image:
|
||||
|
||||

|
||||
|
||||
The normals in the image clearly don't line up with where the light is actually coming from.
|
||||
|
||||
## Encoding Normal data in the canvas_item Vertex Shader Color Parameter
|
||||
|
||||
As SmartShape renders the edges, the textures and their normal textures are also rotated.
|
||||
This will result in incorrect normals.
|
||||
To solve this, we can use a shader to correctly calculate the normals.
|
||||
|
||||
The tricky part lies in how few ways there are to pass data to a canvasItem shader on a per-vertex basis.
|
||||
See here for the full list:
|
||||
https://docs.godotengine.org/en/stable/tutorials/shading/shading_reference/canvas_item_shader.html#doc-canvas-item-shader
|
||||
|
||||
Fortunately, the COLOR parameter can be used for this purpose.
|
||||
The COLOR ENCODING paramter of an Edge Material can be used to choose what data is encoded in the
|
||||
Vertex Shader's Color Parameter.
|
||||
|
||||
If we set the COLOR ENCODING value to "Normals", we get this:
|
||||
|
||||

|
||||
|
||||
Ok, so now the normals still look wrong, but the colors look wrong too. Great.
|
||||
|
||||
There is one final step before our normals will be correct. We need to decode the normal data in a shader.
|
||||
|
||||
|
||||
## Writing a Shader
|
||||
|
||||
You'll want to assign a new shader to the Edge Material's material property.
|
||||
This shader will determine how each edge is rendered.
|
||||
|
||||
Here's a sample shader to decode our normal data and set our actual color to that of our diffuse texture:
|
||||
|
||||
```glsl
|
||||
shader_type canvas_item;
|
||||
|
||||
varying mat2 NORMAL_MATRIX;
|
||||
|
||||
void vertex() {
|
||||
NORMAL_MATRIX = mat2(COLOR.rg, COLOR.ba)*2.0 - mat2(vec2(1.0), vec2(1.0));
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
NORMAL.xy = NORMAL_MATRIX*NORMAL.xy;
|
||||
COLOR = texture(TEXTURE, UV);
|
||||
}
|
||||
```
|
||||
|
||||
After assigning this shader the the Edge Material's material property, our normals finally look right:
|
||||
|
||||

|
136
addons/rmsmartshape/documentation/Quickstart.md
Normal file
@@ -0,0 +1,136 @@
|
||||
# SmartShape2D - QuickStart
|
||||
---
|
||||

|
||||
|
||||
If you feel like your workflow with SmartShape2D is a little bit slow, try reading [Controls and Hotkeys](./Controls.md). The hotkeys may help you work with the tool more effectively.
|
||||
|
||||
## Basic understanding
|
||||
SmartShapes work similarly to [tilesets](https://docs.godotengine.org/en/latest/tutorials/2d/using_tilesets.html) but are not bound to a grid. They can be used to create polygons and even organic shapes. This allows for level design akin to [Rayman Legends](https://youtu.be/WFu1utKAZ18?si=_33TaErpHSh-r732&t=916) (based on the UbiArt Framework).
|
||||
|
||||
Each SmartShape is made up of multiple textures that are responsible for rendering different aspects like corners or edges:
|
||||
|
||||

|
||||
|
||||
## Creating a Shape
|
||||
|
||||
<!-- TODO: Outdated, including screenshots. -->
|
||||
|
||||
- First, instance a node of either:
|
||||
- SS2D_Shape_Open
|
||||
- **SS2D_Shape_Closed**
|
||||
- **We'll use a closed shape for this Quickstart demo**
|
||||
- SS2D_Shape_Base cannot be instanced directly
|
||||
- SS2D_Shape_Anchor is a node that attaches to a shape
|
||||
- The following Nodes are legacy nodes and are deprecated:
|
||||
- RMSmartShape2D
|
||||
- RMSmartShape2DAnchor
|
||||
|
||||

|
||||
|
||||
## Editing the Shape
|
||||
|
||||
- After creating the shape node, make sure it's selected and the toolbar appears and is in Point Edit mode
|
||||
- 
|
||||
- Hold ALT and Left Click on the viewport to add points
|
||||
- If this is a closed shape, the polygon will close after adding the 3rd point
|
||||
- You should now have a shape consisting of a few points and lines:
|
||||
|
||||

|
||||
|
||||
## Setting the Fill Texture of the Shape (Closed Shape only)
|
||||
|
||||
- To give it some life, we'll want to edit the "Shape Material" in the Inspector
|
||||
- Under "Shape Material" Expand "Fill Textures" and you'll see an empty array
|
||||
- Set the Array's size to '1'
|
||||
- Assign a texture to the newly created slot in the array
|
||||
- After assigning the shape should now have a valid texture
|
||||
- If nothing happens after setting the texture, try to force the shape to update by adjusting one of the points
|
||||
- **Note that "Fill Textures" does not affect open shapes at all**
|
||||
- If you want to add a normal_texture, you would add it using the "Fill Texture Normals" property
|
||||
|
||||

|
||||
|
||||
## Texturing the Edges
|
||||
|
||||
- This where the rubber hits the road, the real meat of the tool
|
||||
- Under "Shape Material" add an element to the "Edge Meta Materials" property
|
||||
- Shape Material -> Edge Meta Materials
|
||||
- Set the resource of the newly created element to "SS2D_Material_Edge_Metadata"
|
||||
- Unfortunately, due to Godot limitations, every avaiable resource will offered to you instead of the one you want
|
||||
- The options are alphabetized though, which helps in finding the resource you want
|
||||
- Expand the first element of the "Edge Meta Materials" that you just set
|
||||
- Shape Material -> Edge Meta Materials -> element 1
|
||||
- Set the value of the "Edge Material" property to a new resource of type "SS2D_Material_Edge"
|
||||
- Shape Material -> Edge Meta Materials -> element 1 -> Edge Material
|
||||
- Expand "Edge Material" that you just set
|
||||
- Add an element to "Textures" and assign the texture to one that you want to use as an edge
|
||||
- The shape's edges should now update using the texture you set
|
||||
- If nothing happens after setting the texture, try to force the shape to update by adjusting one of the points
|
||||
- If you want to add a normal_texture, you would add it using the "Texture Normals" property
|
||||
- Godot should now look something like this:
|
||||
|
||||

|
||||
|
||||
### Corners
|
||||
|
||||
- If your shape has sharp 90-degree corners, the texture can look a bit warped in those places
|
||||
- You can specify a unique texture to use for inner and outer corners for each Edge Material
|
||||
- The following Edge Material properties are used for corners
|
||||
- Textures Corner Inner
|
||||
- Texture Normals Corner Inner
|
||||
- Textures Corner Outer
|
||||
- Texture Normals Corner Outer
|
||||
- See how the addition of outer corner textures improves the square created earlier
|
||||
|
||||

|
||||
|
||||
### Multiple Edge Materials in One Edge
|
||||
|
||||
- You can add as many Edge Meta Materials as you want to a Shape Material, each with their own Edge Material
|
||||
- For instance, you can add an additional egde with a rock texture (and its own set of corner textures) and have it render behind the grass
|
||||
- To have it render behind the grass, Set the Z index of the meta material
|
||||
|
||||

|
||||
|
||||
### Normal Range
|
||||
|
||||
- Each Meta material has a Normal Range
|
||||
- The Normal Range indicates when a texture should be rendered
|
||||
- If the normal range is 0 - 360 or 0 - 0, then any angle is considered in range and the edge will always render
|
||||
- Angle "0" is Facing directly Right
|
||||
- Angle "90" is Facing directly Up
|
||||
- Angle "180" is Facing directly Left
|
||||
- Angle "270" is Facing directly Down
|
||||
|
||||
- If you wanted to, for example:
|
||||
- Have rocks display on the bottom part of the shape only
|
||||
- Have grass display on the sides and top of the shape only
|
||||
- You could:
|
||||
- Set the grass Normal Range to 0 - 180
|
||||
- Set the rock Normal Range to 181 - 359
|
||||
|
||||

|
||||
|
||||
### Material Overrides
|
||||
|
||||
- Using Material Overrides will allow you to change how specific edges are rendered
|
||||
- For Example, to prevent the left edge from rendering, we'll do the following:
|
||||
- Select the edge edit button from the toolbar 
|
||||
- Right Click the left edge of the shape
|
||||
- Press the "Material Override" Button
|
||||
- Uncheck the "Render" Checkbox
|
||||
|
||||

|
||||
|
||||
- You can use material overrrides to also specify a specific material for a single edge
|
||||
- For example, Checking Render and choosing the "Rock" Edge Material will cause the edge to render as rocks, even though the NormalRange configuration would otherwise have it render as grass
|
||||
|
||||
### Multiple Textures
|
||||
|
||||
- If more than one texture is specified for an Edge Material, you can specify which texture should be used
|
||||
- Enter Point Edit mode, mouseover a point, and scroll up or down to change the texture index
|
||||
|
||||
## Anchoring Nodes to the Shape
|
||||
|
||||
- To anchor nodes directly to the SmartShape2D node, use SmartSahpeAnchor2D
|
||||
- You can then make nodes children to the anchor
|
115
addons/rmsmartshape/documentation/Resources.md
Normal file
@@ -0,0 +1,115 @@
|
||||
# SmartShape2D - Resources
|
||||
|
||||
<!-- TODO: Not all properties are covered. -->
|
||||
|
||||
## Shape Materials
|
||||
|
||||
Shape materials provide all the texture and collision information needed by the SmartShape nodes.
|
||||
Once a shape material is defined, it can be easily reused by any number of SmartShape2D nodes.
|
||||
|
||||
- Edge Meta Materials
|
||||
- An array of resources of type SS2D_Material_Edge_Metadata
|
||||
- Fill Textures
|
||||
- Used as the texture for the inside of the polygon for Closed Shapes
|
||||
- Currently, only the first texture can be used, multiple textures may be supported at a later date
|
||||
- Normal Textures
|
||||
- In Godot 4, you can set normal textures with `CanvasTexture` resource.
|
||||
- Fill Texture Z Index
|
||||
- Each Edge Meta Material has a ZIndex indicating which edges are drawn first
|
||||
- This sets the ZIndex for the fill texture
|
||||
- This allows the user to draw the fill texture in front of some edges or behind others
|
||||
- Fill Mesh Offset
|
||||
- The Offset of the Fill Mesh
|
||||
- Can be used to grow / shrink the fill mesh
|
||||
- Render Offset
|
||||
- Every edge in the shape will be offset by this amount
|
||||
- Weld
|
||||
- Whether or not to weld the last quad of an edge with the first quad of the next edge
|
||||
|
||||
## Edge Meta Material
|
||||
|
||||
An Edge Meta Material doesn't contain the actual textures used to render an edge like **Edge Material** does.
|
||||
Instead, this resource contains a single **Edge Material** and describes how and when to render the edge.
|
||||
|
||||
- Normal Range
|
||||
- The angles at which an edge is allowed to be rendered
|
||||
- Weld
|
||||
- Whether or not to weld the quads in this edge
|
||||
- Taper Sharp Corners
|
||||
- Edge vertices sharper than 90° that aren't rendered as corners, will be tapered and not welded
|
||||
- Will not work properly on shapes with curves
|
||||
- Render
|
||||
- Whether or not this edge is visible
|
||||
- Z Index
|
||||
- Dictates the order in which edges are drawn
|
||||
- Offset
|
||||
- Offset of the edge
|
||||
- Can use a positive or negative value to draw the edges closer or further from the shape
|
||||
|
||||
## Normal Range
|
||||
|
||||
The Normal Range indicates when a texture should be rendered.
|
||||
Each shape will compare the Surface Normal of an edge to the Normal Range in each Edge Meta Material.
|
||||
If the edge's Normal is inside a Meta Material's Normal Range, the Meta Material's Edge Material is rendered.
|
||||
|
||||

|
||||
|
||||
- A Normal Range is specified in Degrees
|
||||
- If the normal range is 0 - 360 or 0 - 0, any angle is considered in range and the edge will always render
|
||||
- Angle "0" is Facing directly Right
|
||||
- Angle "90" is Facing directly Up
|
||||
- Angle "180" is Facing directly Left
|
||||
- Angle "270" is Facing directly Down
|
||||
|
||||
## Edge Material
|
||||
|
||||
The actual textures used to define an edge
|
||||
|
||||
### Textures
|
||||
|
||||
- The primary textures used for the edge
|
||||
- At least one texture must be defined
|
||||
- Example: 
|
||||
|
||||
### Taper Textures
|
||||
|
||||
These textures will be used as the first or last quad in an edge.
|
||||
They're named "Taper Textures" because the purpose is to show the edge "tapering off"
|
||||
- Textures_Taper_Left is the first quad in an edge
|
||||
- Example: 
|
||||
- Textures_Taper_Right is the final quad in an edge
|
||||
- Example: 
|
||||
|
||||
### Corner Textures
|
||||
|
||||
These textures will be used when the edge forms a sharp corner (80 degrees - 100 degrees)
|
||||
These are used because corners can look warped when using only regular textures
|
||||
- Texture_Corner_Inner is used when the corner forms an inner corner
|
||||
- Example: 
|
||||
- Texture_Corner_Outer is used when the corner forms an outer angle
|
||||
- Example: 
|
||||
|
||||
### Normal Texture and Repeat
|
||||
|
||||
To use normal textures, you can create a `CanvasTexture` resource in the inspector on any property,
|
||||
that allows to set a texture. There you can assign your texture and your normal texture, as well as set
|
||||
those to `repeat`.
|
||||
|
||||
### Repeat Textures
|
||||
|
||||
See previous section.
|
||||
|
||||
### Fit Mode
|
||||
|
||||
Most likely, the textures you use will not *perfectly* fit the polygon.
|
||||
This setting allows you to determine how SmartShape will rectify this.
|
||||
|
||||
Differt options may look better or worse depending on the art-style.
|
||||
|
||||
- Sqush and Stretch
|
||||
- Texture will be mutated
|
||||
- Either slightly squished or stretched to fit the polygon
|
||||
- Crop
|
||||
- Texture will not be mutated
|
||||
- Texture will simply be cropped when changing from one texture to the next
|
||||
|
88
addons/rmsmartshape/documentation/Shapes.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# SmartShape2D - Shapes
|
||||
|
||||
Each shape consists of a set of points. You can directly edit either the points or the edges between the points in the viewport.
|
||||
|
||||
Shapes are configured to use a [Shape Material](./Resources.md#ShapeMaterial) which determines how the shape is rendered.
|
||||
|
||||
A shape can be open or closed. Each new shape starts open. To close a shape, simply add a point on top of the first one.
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
> 🛈 Most properties now have documentation comments.
|
||||
|
||||
<!-- TODO: this is incomplete - not all properties are here -->
|
||||
|
||||
### Editor Debug
|
||||
|
||||
- Will show the bounding box for each quad in the mesh of edges.
|
||||
- Can be helpful to illustrate why a shape doesn't look the way you expect.
|
||||
|
||||
### Flip Edges
|
||||
|
||||
- Will flip the edges of the shape (invert y).
|
||||
|
||||
### Render Edges
|
||||
|
||||
- Whether or not the edges of the shape should be rendered.
|
||||
|
||||
### Collision Size
|
||||
|
||||
- Size of the collision shape.
|
||||
|
||||
### Collision Offset
|
||||
|
||||
- Offset of where the collision shape starts and ends.
|
||||
- A **positive** value offsets the collision shape **outwards**.
|
||||
- A **negative** value offsets the collision shape **inwards**.
|
||||
|
||||
### Tessellation Stages
|
||||
|
||||
- Number of stages in the curve tessellation process (Uses Curve2D Internally).
|
||||
- First Param in Curve2D.tessellate.
|
||||
- See [Curve2D Documentation](https://docs.godotengine.org/en/3.2/classes/class_curve2d.html#class-curve2d-method-tessellate).
|
||||
|
||||
### Tessellation Tolerence
|
||||
|
||||
- Tolerence Degrees in the curve tessellation process (Uses Curve2D Internally).
|
||||
- Second Param in Curve2D.tessellate.
|
||||
- See [Curve2D Documentation](https://docs.godotengine.org/en/3.2/classes/class_curve2d.html#class-curve2d-method-tessellate).
|
||||
|
||||
### Collision Generation Method
|
||||
|
||||
- Controls which method should be used to generate the collision shape.
|
||||
- See also in-engine documentation.
|
||||
|
||||
### Collision Update Mode
|
||||
|
||||
- Controls when to update collisions.
|
||||
- See also in-engine documentation.
|
||||
|
||||
### Curve Bake Interval
|
||||
|
||||
- Bake interval value for Curve2D.
|
||||
- See [Curve2D Documentation](https://docs.godotengine.org/en/3.2/classes/class_curve2d.html#class-curve2d-property-bake-interval).
|
||||
|
||||
### Collision Polygon Node Path
|
||||
|
||||
- The path to the CollisionShape that the SmartShape will use for collision.
|
||||
- Is Autoset when pressing the generate collision button.
|
||||
|
||||
### Shape Material
|
||||
|
||||
- The material that this shape will use to render itself.
|
||||
- For backwards compatibility `fill_texture_z_index` defaults to `-10`. Set this to `0` and enable `fill_texture_show_behind_parent` in order to preserve Godot's normal z-sorting when layering with other nodes.
|
||||
|
||||
### Points
|
||||
|
||||
- **There is no need to edit this property by hand, but you can if you'd like.**
|
||||
- Contains all of the points and meta-data for the points contained in this shape.
|
||||
- This data structure is updated as you manipulate the shape.
|
||||
|
||||
### Material Overrides
|
||||
|
||||
- **There is no need to edit this property by hand, but you can if you'd like.**
|
||||
- When an edge is given a "Material Override" the data for that edge is stored here.
|
||||
- This data structure is updated as you manipulate the shape.
|
||||

|
||||
|
53
addons/rmsmartshape/documentation/Toolbar.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# SmartShape2D - Toolbar
|
||||
|
||||

|
||||
|
||||
<!-- TODO: Incomplete set of tools presented here. -->
|
||||
|
||||
## Create Mode
|
||||
|
||||
- In this mode you can start creating a new shape.
|
||||
- Left-Click anywhere to add a new point.
|
||||
- Press ESCAPE to exit create mode.
|
||||
- Hold down ALT and Left-Click to create a point between the two points closest to your mouse.
|
||||
|
||||
## Point Mode
|
||||
|
||||
- In this mode you can add, delete, and move all of the points that make up a shape
|
||||
- To **Add** a new point to the shape:
|
||||
- Hold down ALT and Left-Click anywhere on the viewport to add a point between the two points closest to your mouse.
|
||||
- Left-Click on an edge between two points.
|
||||
- To **Move** a point, Left-Click on any point and drag
|
||||
- To **Delete** a point, Right-Click on any point
|
||||
- To set the **Control Points** of a point (for curves), hold **Shift**, Left Click on any point and drag
|
||||
- After the Control Points have been set, you can edit them individually by Left-Clicking and dragging
|
||||
- You can delete control points by right clicking them
|
||||
- To make an empty clone SmartShape2D, hold down ALT + SHIFT and Left-Click anywhere in the viewport.
|
||||
|
||||
## Edge Mode
|
||||
|
||||
- In this mode you can Move Eges and choose how specific edges are rendered
|
||||
- To **Move** an Edge, Left Click and Drag the Edge
|
||||
- To **Change an Edges Rendering**, right click the edge and press "**Material Override**"
|
||||

|
||||
|
||||
- This popup allows you to **change how edges are rendered**
|
||||
- **Render** will toggle whether or not this edge will be drawn with Edge Materials
|
||||
- **Set Material** allows you to choose a specific Edge Material to use to render this edge
|
||||
|
||||
## Origin Set
|
||||
|
||||
- This tool allows you to set the origin of any SmartShape
|
||||
- To **Set the Origin** Left Click anywhere on the viewport
|
||||
|
||||
## Generate Collision
|
||||
|
||||
- If you want your shape to have collision, press this button to autogenerate the collision nodes
|
||||
- The shape will be made a child of a newly created **StaticBody2D**
|
||||
- A sibling node, **CollisionPolygon2D** will also be created and added to the SceneTree
|
||||
- The "Collision Polygon" parameter of the Shape will be set to this sibling **CollisionPolygon2D**
|
||||
|
||||
## Snapping
|
||||
|
||||
When Moving / Adding points, snapping will cause the positions of the points to snap to the grid. This works the same as Godot's built-in snapping.
|
||||
You can have snapping either use Global Space, or space relative to the shape's origin.
|
117
addons/rmsmartshape/documentation/VersionHistory.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# Version History
|
||||
|
||||
## 2.x
|
||||
### 2.2
|
||||
January 4th 2021
|
||||
### Fix
|
||||
- Fix for crash that would occur when points were aligned *just* right
|
||||
- See issue 66
|
||||
+ https://github.com/SirRamEsq/SmartShape2D/issues/66
|
||||
### Features
|
||||
- Each Edge Material can now have a Material (Shader)
|
||||
- Each Edge Material Meta can have a z-index and z-as-relative set
|
||||
- See issue 64
|
||||
+ https://github.com/SirRamEsq/SmartShape2D/issues/64
|
||||
|
||||
### 2.1
|
||||
December 14th 2020
|
||||
#### Significant Changes from 2.0
|
||||
- Improved Width handling
|
||||
- Improved Welding
|
||||
- Rendering is now achieved by having multiple child-nodes each render a piece of the shape
|
||||
+ Previously, all the rendering was done by the shape node
|
||||
+ Improves performance
|
||||
+ Fixes lighting bugs
|
||||
- Point Creation mode reimplemented
|
||||
+ Mode active by default
|
||||
+ Can be exited by pressing ESC
|
||||
- Several usability additions
|
||||
+ Hotkey for grabbing closest point
|
||||
+ Hotkey for creating new shape at point
|
||||
+ Width Grabber for closest point
|
||||
+ Preview for adding points
|
||||
- Several Bug fixes and issues closed
|
||||
#### New Features
|
||||
- Meta Shapes Introduced
|
||||
- "Fit mode" added to edge material
|
||||
+ Can either squash and stretch the texture or crop it
|
||||
#### Minor Changes
|
||||
- Changes to GUI Theme
|
||||
+ More in line with standard Godot
|
||||
- Add windows scripts for running unit tests
|
||||
- Changed default snap settings to 8x8 pixels
|
||||
|
||||
### 2.0
|
||||
September 7th 2020
|
||||
#### Significant Changes from 1.0
|
||||
- Edge Textures are no longer determined by a cardinal direction (UP, DOWN, LEFT, RIGHT)
|
||||
- Instead, a starting and ending normal angle is specified for each edge
|
||||
- Textures are now defined per-edge instead of per-shape
|
||||
#### New Features
|
||||
- Taper textures
|
||||
- Instead of simply ending, the user can have an edge "taper-off"
|
||||
- Editing by Edges
|
||||
- Material Overrides
|
||||
#### Internal Changes
|
||||
- Completely overhauled everything
|
||||
- A rudimentary constraint system is in place
|
||||
- Closed shapes will add a point when closing, then constrain the added point's position to the first point
|
||||
- Points are no longer refered to by index, they are refered to by keys
|
||||
- This enables points to have relationships that aren't affected when:
|
||||
- Adding/Removing a point
|
||||
- Changing orientation of the poly
|
||||
- Many Unit and Integration tests
|
||||
- Refactored original working code to better support testing
|
||||
- Kept original scripts and classes from version 1.0 to ease importing
|
||||
|
||||
## 1.x
|
||||
### Changes in 1.3
|
||||
This update primarily fixes bugs and improves existing features to be more usable.
|
||||
#### Changes
|
||||
- Merged top/left/right/bottom offset into one variable. render offset
|
||||
#### Fixes
|
||||
- Input bugs
|
||||
- Edge Flipping
|
||||
- Polygon orientation bugs
|
||||
- Quad Welding
|
||||
- Corer quad generation and welding
|
||||
- Collision variables in the RMSmartShapeMaterial working as intended
|
||||
|
||||
### Changes in 1.2
|
||||
#### Tweaks
|
||||
- Refactoring
|
||||
- Toolbar takes less space
|
||||
- Minor bug fixes
|
||||
|
||||
#### New Features
|
||||
- Bezier Curves!
|
||||
- Hold shift on a control point to create a curve
|
||||
- Corner Quads!
|
||||
- Both inner and outer corner quads are now generated
|
||||
- Textures can be speciied for each direction of both inner and outer quads
|
||||
- Edge Moving!
|
||||
- Can move an edge (two points) by pressing SHIFT in move mode and dragging the edge
|
||||
|
||||
### Changes in 1.1
|
||||
- Refactoring
|
||||
- Fixed Errors Occuring when Texture Arrays are size '0' but not null
|
||||
- Fixed sync between texture, flip, and width indicies
|
||||
- Would sometimes share a single array between the 3 vars
|
||||
- Are all unique now
|
||||
|
||||
- Snapping
|
||||
- More informative toolbar
|
||||
|
||||
### Changes in 1.0
|
||||
- Fixed many debug errors reported related to indexing beyond array sizes
|
||||
- Fixed control point wrapping of RMSmartShapeAnchor2D nodes anchored to RMSmartShape2D nodes.
|
||||
- Tested on newly released 3.2 Godot.
|
||||
|
||||
### Changes in 0.91
|
||||
- Edges are calculated in relationship to object space instead of screen space
|
||||
- Added option to allow user to let the object recalculate edges based on screen space.
|
||||
- Fixed uv calculations for flipped textures.
|
||||
- Fixed uv bug for edge sections less than half the size of texture width
|
||||
- Added option to allow for a RMSmartShapeAnchor to mimic scale of monitored node
|
||||
- Removed sections of code related to clockwise versus clockwise checks, very specifically regarding the direction of texture edges.
|
||||
- Corrected normal texture bug for fill and edge rendering
|
BIN
addons/rmsmartshape/documentation/imgs/AngleExplaination.png
Normal file
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 63 KiB |
BIN
addons/rmsmartshape/documentation/imgs/EdgeEdit-NoRender.png
Normal file
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 65 KiB |
BIN
addons/rmsmartshape/documentation/imgs/NewNode-SS2D_Nodes.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
addons/rmsmartshape/documentation/imgs/NormalColors.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
addons/rmsmartshape/documentation/imgs/NormalCorrect.png
Normal file
After Width: | Height: | Size: 152 KiB |
BIN
addons/rmsmartshape/documentation/imgs/NormalWrong.png
Normal file
After Width: | Height: | Size: 153 KiB |
BIN
addons/rmsmartshape/documentation/imgs/PluginActivate.png
Normal file
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 22 KiB |
BIN
addons/rmsmartshape/documentation/imgs/Toolbar-PointEdit.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
addons/rmsmartshape/documentation/imgs/canvas-item-repeat.png
Normal file
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 41 KiB |
BIN
addons/rmsmartshape/documentation/imgs/faq-texture-repeat.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 37 KiB |
BIN
addons/rmsmartshape/documentation/imgs/grass-corner-inner.png
Normal file
After Width: | Height: | Size: 379 B |
BIN
addons/rmsmartshape/documentation/imgs/grass-corner-outer.png
Normal file
After Width: | Height: | Size: 350 B |
BIN
addons/rmsmartshape/documentation/imgs/grass-taper-left.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
addons/rmsmartshape/documentation/imgs/grass-taper-right.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
addons/rmsmartshape/documentation/imgs/grass.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
addons/rmsmartshape/documentation/imgs/icon_edge.png
Normal file
After Width: | Height: | Size: 326 B |
BIN
addons/rmsmartshape/documentation/imgs/sample.gif
Normal file
After Width: | Height: | Size: 7.0 MiB |
BIN
addons/rmsmartshape/documentation/imgs/sample.png
Normal file
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 673 KiB |