microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
726 stars 638 forks source link

Sprite editor for microbit #2448

Closed samnied closed 4 years ago

samnied commented 5 years ago

I'm currently developing an extension for neopixel matrices with 16x16 pixels. There for I need an editor to enter colored pixel images.

As the makecode arcade environment provides a sprite editor with all the features I need, I'm looking for a way to port the sprite editor to the microbit environment (in the best way as an extension).

I already developed a few small extensions but nothing that "big". I would appreciate all kind of suggestions and hints on how to do it.

I already contacted a few developers, they told me to mention @riknoll.

riknoll commented 5 years ago

So, this should be totally possible but it might be a little involved. Adding the sprite editor to a block is the easy part; you can see where the image editor block is defined for arcade here. The hard part is going to be porting over the Image class from arcade. That class is defined in the screen package.

You might be able to get away with just copying the definition of the image literal like this:

/**
 * Tagged image literal converter
 */
//% shim=@f4
//% groups=["0.","1#","2T","3t","4N","5n","6G","7g","8","9","aAR","bBP","cCp","dDO","eEY","fFW"]
function img(lits: any, ...args: any[]): Buffer { return null }

But you'll need to parse the Buffer that gets returned. @mmoskal is the image format documented somewhere? I saw the comment here.

samnied commented 5 years ago

@riknoll Many thanks for your help. Would it be possible to get in contact with you for some further questions ? samuel.niederer@hsr.ch

riknoll commented 5 years ago

Feel free to ask them here!

samnied commented 5 years ago

Okey so our team isn't that experienced with the whole pxt environment and the time is running. We are looking for someone who could help us to port the whole editor, for a valuable consideration of course. I wondered if you or someone you know would be interested in doing that for us.

riknoll commented 5 years ago

Sorry, I'm not available and I don't know of anyone offhand who might be able to help with this. I'm happy to answer any technical questions that come up in the process though!

pelikhan commented 5 years ago

We should refactor out the image API into a separate package that would be usable in microbit land...

pelikhan commented 5 years ago

The sprite editor would allow to draw images for neopixel matrices...

abchatra commented 4 years ago

Won't fix for the next release.