Re-skinning Blockly for Web

315 views
Skip to first unread message

Adam

unread,
May 23, 2017, 2:50:58 PM5/23/17
to Blockly
Hiya,

I'm looking to re-skin blockly blocks by changing their shape, size, corners, etc.

I'm not finding an intuitive way to manage this and am wondering if this is something easily supported or do I need to dig deep into code and change how blocks are generated?

Thanks,
A

Erik Pasternak

unread,
May 23, 2017, 4:23:23 PM5/23/17
to Blockly
Hi Adam,

We don't have any direct support for this. Most of the blocks are drawn using generated svg paths so that they can support blocks of any configuration, which also makes it hard to modify. There's been some work over the last couple years to separate out the svg code from the model, and we worked with the Scratch team at MIT to do a major reskin for Scratch-Blocks, but it's still a large amount of work.

Cheers,
Erik

Adam

unread,
May 23, 2017, 4:50:59 PM5/23/17
to Blockly
Okie doke! Thanks for your response :)

A

Rachel Fenichel

unread,
May 24, 2017, 2:05:26 PM5/24/17
to Blockly
If you're feeling brave you can definitely reskin it--you'll just have to be careful to test all of the cases, and you'll need to be comfortable with SVG.

All of the rendering code is in block_render_svg.  You should be able to change the constants at the top for small tweaks.  Let us know if that works for you.

Cheers,
Rachel
Reply all
Reply to author
Forward
0 new messages