Create custom shapes for connecting blocks like Tetris

167 views
Skip to first unread message

Chirav Dave

unread,
Aug 30, 2018, 3:34:03 PM8/30/18
to blo...@googlegroups.com
Hello Team,

I am creating an application like tetris to help end users to program a code very efficiently. I am stuck with creating custom shapes for next and previous connection for every block. Here are my questions :

1) Can I supply multiple options for next connection while describing my block in the json format because I tried using a list and it didn't work

2) How can I individually change the next and previous connection shape as the field Blockly.BlockSvg.NOTCH_PATH_LEFT is common for next and previous connection

Please, give some insight

Thanking You,
Chirav Dave

Erik Pasternak

unread,
Aug 30, 2018, 7:04:16 PM8/30/18
to Blockly
Hi Chirav,

This is not supported in Blockly's core library. You'd need to make some significant changes to block_render_svg.js, block.js, and probably elsewhere throughout the code to handle that big a change to rendering. You can take a look at Scratch Blocks or and the changes they've made to rendering to get some idea of which files to start in, but it'll take a lot of working through the code and learning how Blockly's rendering works.

Sorry I can't be more helpful.

-Erik
Reply all
Reply to author
Forward
0 new messages