-
Notifications
You must be signed in to change notification settings - Fork 129
Terminology
Every object on the drawboard is a Node
. Typical Node
s are:
-
ImageNode
, which represents an image. -
TextNode
, which represents a piece of text. -
Group
, which represents a group ofNode
.
In the context of carefree-drawboard
🎨, a SingleNode
represents one single Node
which is not a Group
. Which means:
- Multiple
Node
s is NOTSingleNode
. -
ImageNode
isSingleNode
. -
TextNode
isSingleNode
. -
Group
is NOTSingleNode
.
Pivot
is an important concept when we need to position our plugins. All supported Pivot
s are:
-
lt
: left top corner. -
top
: top center. -
rt
: right top corner. -
left
: middle left. -
center
: middle center. -
right
: middle right. -
lb
: left bottom corner. -
bottom
: bottom center. -
rb
: right bottom corner.
meta
is an important design in carefree-drawboard
🎨. It not only contains the necessary parameters to construct every Node
, but also records where did every Node
'comes from'. Typical meta looks like:
{
"type": "python.httpFields",
"data": {
"identifier": "blur",
"parameters": {
"size": 3
},
"response": {
"type": "image",
"value": {
"w": 512,
"h": 512,
"url": "http://localhost:8123/.images/7a0c03ee49826346d8a14d286a47bec4.png"
}
},
"duration": 0.255584716796875,
"from": {
"type": "upload",
"data": {
"w": 512,
"h": 512,
"url": "http://localhost:8123/.images/15f6953b5392bd6970bafd1e7a30641e.png",
"isDrag": false,
"timestamp": 1681536118280
}
},
"timestamp": 1681536121263
}
}
As you can see, there's a from
field in data
, which represents the Node
's 'origin'. In this case, the Node
is blurred from an image uploaded by the user.
The ability to trace every
Node
's history is essential for:
- Knowing exactly how a beautiful creation is generated step by step, thus make it possible to re-use some of them.
- Much more potential possibilities, such as making Games with it.
In carefree-drawboard
🎨, a 'Definition' is often a key-value pair, which represents a parameter used in a PythonHttpFieldsPlugin
(or also in PythonSocketFieldsPlugin
in the future). Its key represents the parameter's name, and its value is an IFieldDefinition
.
See
PythonHttpFieldsPlugin
for more details.