I want Dummy Input to support variables like scratch

220 views
Skip to first unread message

邓益平

unread,
Feb 19, 2019, 5:49:19 AM2/19/19
to Blockly

Snipaste_2019-02-19_18-46-01.png

i found that scratch and make code all did this.

pls give me some advice


Amber B

unread,
Feb 19, 2019, 8:51:01 AM2/19/19
to Blockly
I'm a little confused by what you're asking here. Do you mean having an input where you can type in a number but where you can also put a variable? If so, then you actually probably want a value input with a shadow number block. See more here: https://developers.google.com/blockly/guides/configure/web/toolbox#shadow_blocks

邓益平

unread,
Feb 19, 2019, 10:10:30 PM2/19/19
to Blockly
Thank you for your reply, I have made a new picture.


Snipaste_2019-02-20_11-08-16.png



在 2019年2月19日星期二 UTC+8下午9:51:01,Amber B写道:

Andrew n marshall

unread,
Feb 19, 2019, 10:49:04 PM2/19/19
to blo...@googlegroups.com
The quick answer is to use PXT-Blockly, the Microsoft fork that is used by the MakeCode team. It attempts to port the scratch-blocks rendering style, while supporting most (not quite all) google/blockly features. We are working with Microsoft to make some variant of this rendering style a built-in option for google/blockly.

With both pxt-blockly and scratch blocks, you'll want a value input with either a math_number or text shadow block attached. A single field_dropdown shadow block might also work.



--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

邓益平

unread,
Feb 20, 2019, 8:06:50 AM2/20/19
to Blockly
Thanks !

在 2019年2月20日星期三 UTC+8上午11:49:04,Andrew n marshall写道:

Andrew

unread,
Feb 6, 2020, 11:37:15 AM2/6/20
to Blockly
My attempt to leverage the PXT-Blockly Github project was not successful.  There were parts of the designer that failed to work properly - in particular the mutator for the If-Then-Else construct failed to render correctly making the use of it impossible.  I'm interested to hear if anyone else has had success with this as I prefer the more professional look and feel of the blocks in that project versus the standard blockly style.
To unsubscribe from this group and stop receiving emails from it, send an email to blo...@googlegroups.com.

Sam El-Husseini

unread,
Feb 6, 2020, 12:21:13 PM2/6/20
to Blockly
Hey Andrew, 

We actually now support the MakeCode/Scratch style of blocks built-in Blockly since v3.20200123.1 with the "zelos" renderer. 
If you upgrade to that version of Blockly, you can switch renderers by passing in "renderer": "zelos" with your workspace options.

Let us know how you go!

Cheers,
Sam

Andrew

unread,
Feb 6, 2020, 2:36:25 PM2/6/20
to Blockly
Sam,

Thank you very much for your response that saved me hours of work and research.  I have this implemented now.  Overall it it looks pretty good but I must say the expanded "create list" block looks a little outrageous when you add more than a few items. :-)

Beka Westberg

unread,
Feb 6, 2020, 3:03:59 PM2/6/20
to Blockly
Hello Andrew,

There's actually a discussion and solution for that problem over on the Blocks don't look visually good thread.

I hope that helps!
--Beka

Xiehua

unread,
Feb 7, 2020, 6:42:46 PM2/7/20
to Blockly
Pretty cooooool ! Thanks very much ;)

在 2020年2月7日星期五 UTC+8上午1:21:13,Sam El-Husseini写道:
Reply all
Reply to author
Forward
0 new messages