I made an Arduino plugin to make building and uploading FX data easy from the Arduno IDE.
Trying out one of the FX examples or just uploading a FX game from source is a breeze now:
Due to limitations of the Arduino IDE, the plugin must be installed manually. To grab the plugin tool and installation info, head over to:
VSCode allows you to configure tasks. The default configuration for verify / build are below. I haven’t loaded your integration yet, but assume you could configure a new task?
// A task runner that compiles / uploads the current .ino sketch
//
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
//
{
"version": "2.0.0",
"command": "arduino",
"tasks": [
{
"label": "--verify",
"type": "shell",
"command": "arduino",
"args": [
"--verify",
"-v",
"${file}"
],
"problemMatcher": {
"owner": "external",
"fileLocation": [
"relative",
"${fileDirname}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
"group": {
"_id": "build",
"isDefault": false
}
},
{
"label": "--upload",
"type": "shell",
"command": "arduino",
"args": [
"--upload",
"-v",
"${file}"
],
"problemMatcher": [],
"group": {
"_id": "test",
"isDefault": false
}
}
]
}
The Arduino command line parameters are very limited. There is no way to launch the tool from command line. So an Arduino VSCode task for it isn’t an option
The dbmReverse image is a little strange as it has rendered a two pixel border whereas the others have not. It does have an odd number Y dimension. Is this incorrect?
Sorry to make you do extra work. I am loving developing with this library - especially as there are more options with the graphics portion.
I tried to make an array of int8_ts today but found that fxdata-build.py did not like negative numbers.
Also, when defining the fxdata file I would love to be able to declare my images within a namspace. Its just a personal habit, but I tend to put images in their own namespace as often their name clashes with the class names of entities.
NP I like the feedback and it only makes the library better.
Ah right ! Will look into it.
can you give an example of that?
BTW drawBitmap also supports frames like Arduboy2 Sprites::draw.
You put all the letter images of LeWord in a single image and make the filename end with ‘_10x11.png’ or _10x11_1.png’ when each frame is padded by 1 pixel for example:
Ok I’ve updated fxdata-build.py of the Arduino plugin and Python utilities.
You can use negative numbers, namespace and current fx data pointer
for negative numbers there may not be a spece between - and the number
a namespace can be defined like in C++ but additionally must be terminated by namespace_end
namespace name
{
}
namespace_end
Note that the curly brackets are purely cosmetic and may be omitted.
To create a constant expresstion that points to the current fx data pointer (compile time) you can use something as
Label = .
Note the ‘.’ is purely cosmetic and may be omitted
Another new feature is that constant expressions are created for image width, height, and the number of frames (the frames constant is only created if there is more than one frame).