(Redirected from Drop-Down Menu)
- This article is about dropdown menus used as inputs for blocks. For information on the creation of dropdown menus in Scratch projects, see How to Make a Dropdown Menu.
A dropdown menu is a list of options that appears in some blocks. It can be accessed by clicking on an upside down triangle in the block.
Scrolling Dropdown Menus
Sometimes, a dropdown menu will be so long that not all options can be viewed at once. Scratch 2.0 had small arrows at the bottom of the menu in these cases, which could be used to scroll through the dropdown menu upon being hovered over with the mouse. In Scratch 3.0, it is possible to scroll through a menu by simply using a mouse or the scroll bar at the side.
Dropdown Menus as Inputs
Sometimes, dropdown menus can be used as string or number inputs. These dropdown menus are rounded. For example, the go to ( v)
block has a dropdown menu:
Block inputs
go to (random position v)
For this block, the dropdown menu can be used as an input as well, meaning that blocks can be dragged in, such as variables:
go to (variable)
Text Inputs
The (join () ())
block can be used as a workaround for the purpose of text input. Just leave the first part of the block empty and enter any text into the second part:
go to (join [][enter text here ...])
Text inputs can be useful for very long dropdown menus, in which entering text can sometimes be easier than scrolling down all the way.
Non-Input Dropdown Menus
Not all dropdown menus work as inputs. Many dropdown menus with a fixed amount of options, like the variable blocks, will not work as inputs. These dropdown menus are rectangular. One example is the show variable [ v]
block:
show variable [not an input v]
It is not possible to place a variable in that spot. However, some Scratchers have found a way around that by "hacking" various Scratch blocks. These could be obtained by editing the project.json file or importing them from another project. However, in Scratch 3.0, these dropdown menus can no longer be inserted with hacked blocks.
Blocks with Dropdown Menus
Note: | This does not include all extension blocks. |
Accept Block Inputs
These blocks allow their dropdown menus to be used as inputs for other blocks:
go to (random position v)
glide () secs to (random position v)
point towards (mouse-pointer v)
switch costume to (costume1 v)
switch backdrop to (backdrop1 v)
switch backdrop to (backdrop1 v) and wait
play sound ( v) until done
start sound ( v)
broadcast (message1 v)
broadcast (message1 v) and wait
create clone of (myself v)
touching (mouse-pointer v)?
distance to (mouse-pointer v)
key (space v) pressed?
[backdrop # v] of (Stage v) // The first menu does not accept block inputs, but the second one does.
play drum (\(1\) Snare Drum v) for (0.25) beats
set instrument to (\(1\) Piano v)
change pen (color v) by (10)
set pen (color v) to (50)
video (motion v) on (sprite v) // Both menus accept block inputs.
turn video (on v)
set voice to (alto v)
set language to (English v)
translate [hello] to ( v)
when (space v) key pressed:: makeymakey
when (left up right v) pressed in order
when (A v) button pressed
(A v) button pressed?
when (moved v):: microbit
display ( v)
when tilted (any v)
tilted (any v)?
tilt angle (front v)
when pin (0 v) connected
motor (A v) turn this way for (1) seconds
motor (A v) turn that way for (1) seconds
motor (A v) set power (100)%
motor (A v) position
when button (1 v) pressed
button (1 v) pressed?
turn motor (A v) for (1) seconds
turn motor (A v) for (1) rotations
turn motor (A v) on
turn motor (A v) off
set motor (ABCD v) speed to (100)%
set motor (A v) direction (this way v) // Both inputs accept block inputs.
motor (A v) position:: boost
when (any color v) brick seen
seeing (any color v) brick?
when tilted (any v):: boost
tilt angle (up v):: boost
turn (motor v) on for (1) seconds
turn (motor v) on
turn (motor v) off
set (motor v) power to (100)
set (motor v) direction to (this way v) // Both inputs accept block inputs.
when distance (\< v) (50)
when tilted (any v):: wedo
tilted (any v)?:: wedo
tilt angle (up v):: wedo
Do Not Accept Block Inputs
These blocks do not accept other blocks in their dropdown menus:
set rotation style [left-right v]
change [color v] effect by ()
set [color v] effect to ()
go to [front v] layer
go [forward v] () layers
costume [number v]
backdrop [number v]
change [pitch v] effect by ()
set [pitch v] effect to ()
when [space v] key pressed
when backdrop switches to [backdrop1 v]
when [loudness v] > ()
when I receive [message1 v]
stop [all v]
set drag mode [draggable v]
[backdrop # v] of (Stage v) // The first menu does not accept block inputs, but the second one does.
current [year v]
[abs v] of ()
set [ v] to (0)
change [ v] by (1)
show variable [ v]
hide variable [ v]
add [thing] to [list v]
delete (1) of [list v]
delete all of [list v]
insert [thing] at (1) of [list v]
replace item (1) of [list v] with [thing]
item (1) of [list v]
item # of [thing] in [list v]
length of [list v]
[list v] contains [thing]?
show list [list v]
hide list [list v]