Oct 17 2011

Simple editor in RICcreator

Category: UncategorizedSpiller @ 00:33

To show a nxtCanvas in QT I made a custom widget called nxtCanvasWidget. nxtCanvasWidget implements everything needed to view, move and edit nxtCanvas. However to add scroolbars I had to create another widget, which is named nxtCanvasWidgetContainer and which contains a nxtCanvasWidget. However it does not include the interface needed to do editing, so another widget called spriteValue is used which includes nxtCanvasWidgetContainer.

To simplify this, I merged nxtCanvasWidgetContainer and spriteValue. In the process I also tried to improve the edit interface.

While far from perfect, it is a bit better than before in my opinion. (I just noticed that the scrollbars have stopped working and probably have been for quite some time. I just love the scroll wheel I guess.)

I have also finally resized the icons, this makes them look quite a bit better than before. I’m still missing icons for bucket fill and crop though.

However now that the editor interface is done and that adding a sprite editor is simplified, I added another editor as visible above. It simply hides everything else than the nxtCanvas.

Editors can be changed with the “View” menu, I have also added a RIC font editor there, but it is not implemented anyway in case you are wondering.

In order to change to the simple editor, a RIC file must be “simple” too. That is, it must only contain one Sprite, one CopyBits (which refers to the sprite) and may have an optional Options element as the first element.


RICcreator rev. 139 – win32.zip (The advanced editor’s tool bar disappears if you change between simple and advanced editor, I think that I’m trying to use QT incorrectly here… Or it might just be a bug…)

Jul 26 2011

RICcreator – July update

Category: UncategorizedSpiller @ 00:50

Another month has passed and truth to be told, that much haven’t happened…

A few thing have been done at least, mostly with the sprite editor.

Import of image files

This feature is pretty important for me, so a quick draft has finally been made:

The options should be done in this order:

  1. Select image
  2. Scale image
  3. Select grayscale conversion method
  4. Change threshold
  5. Cut image

Actually I would want to cut the image before scaling it, as this makes it easier to scale it precisely. It is a bit more work though so this will wait for now.

The second view is a nxtCanvasWidget control, i.e. a nxtCanvas viewer/editor. It should be easy to allow editing the sprite before applying it, you just need to add the tool buttons. I don’t know if this is of interest though.

A lot more work will need to be done on the monotone conversion. Currently a simple global threshold is used (which is automatically calculated btw). I will at least add the possibility of adaptive thresholding and perhaps even edge detection. I will try to look into other filters to see what could be useful.

New nxtCanvasWidget tools

Compared to nxtRICedit, RICcreator is still missing some forms for sprite modification. So a few extra have been added to closing that gap.

The layout needs a helping hand though.

Copy and paste

Together with the selection tool, copying and pasting is now possible. To move the pasted content, you click and drag. To copy it onto the sprite, double click. (Click again and it will paste an extra copy right away.) Invert and Merge options works as well.

Currently a drag operation is started no matter where you click. However clicking outside the copy could be used to apply it onto the canvas, instead of having to double click. (GIMP behavior) I’m not sure what I should go with.


The nxtCanvas automatically becomes larger but there was no option to decrease the size. So cropping is now finally added. It auto-crops empty white borders, black borders if Invert is toggled. However it can be used together with the selection tool to crop to a specific area without regarding the contents.

Bucket fill

Has also been added. It is just a quick inefficient implementation though, but it works. Invert also affects this tool of course.

Missing tools

I will only add one more tool, a text tool which works using RIC fonts. When and how I do not know. (And undo/redo someday…)

I might add polygon drawing if there is interests for it though.

If anyone do not think this tool set is sufficient, tell me what you would like to see and I might add it in the future.

Export to PNG

By using File->Export you can now save the contents of the preview. So if you file is parameterized, set the parameters before executing this command.

You can also export the contents of a RIC sprite, by using the save button in the nxtCanvas editor. If used together with the selection tool it will only save the current selection.

Now that I think about it, is there any way to export as a bitmap image in nxtRICedit? Couldn’t quite find the command.

Other additions

Closing RICcreator by other means than File->Exit will now properly prevent exit if there are unsaved files.

You can now open files by dragging and dropping them into RICcreator from your file-browser. You can drag multiple files at once if you want.


Please bear in mind that this is a preview and that there are several known bugs.

RICcreator rev. 119 – win32

May 22 2011

RICcreator released

Category: UncategorizedSpiller @ 20:51

Currently there is only one real editor to use with the Lego Mindstorms RIC format, nxtRICedit v2 by Andreas Dreier. All other editors, including Lego’s own, only edits the sprite while the format is actually much more advanced than this.

There are a few issues with nxtRICedit though and this made me to try writing my own editor; RICcreator is the result of this attempt. (currently in development)

There are a few clear goals with this project:

  • Cross-platform,it  should work on Mac, Linux and Windows.
  • Open-Source, so it is easier to incorporate the format in other applications or continue to improve the program even if the original developer loses interest.
  • The user must be able to do everything the format supports.
  • It should support John Hansen’s additions to the format.
  • The program window must be resizable.
  • It should make the creation of RIC fonts easier.

RICcreator is available through SourceForge here: http://sourceforge.net/projects/riccreator/

The program is written in C++ using QT for the GUI. The code that handles the RIC format is kept separate and does not use QT in any way which should make it easier to reuse it.