I really want to know how to make a menu. Like this:
Are the JS dialog boxes not enough?
No, they're not enough.
I think you can use MenuMorph
in some way. You may need to look through the source code to see how to use it, though.
Can you give me a block that can give me a menu with a set of items?
I don't know how to do that.
You may start with
JS
let result = false;
let menu = new MenuMorph( (item)=>{result=item});
menu.addItem( "A", "A");
menu.addItem( "B", "B");
menu.popUpAtHand( this.world());
return ()=>result;
How to you make the "when not false" block?
How can I give it a title?
The JS function SpriteMorph.prototype.inform(string)
will make a menu with the string as the title and one OK button. I don't know about custom buttons though
SpriteMorph.prototype
just refers to the basic functions of sprites. use this.inform
Okay.
what about with multiple items input?
You can Shift click and "switch to dev mode". Then right-click & "inspect" to see how something is built internally. Next, you can look at the source code.
Menu closes after Enter
oh i mean
how to do something like
(output menu of [Apple] [Banana] [Orange] @</span>delInput @</span>addInput:: grey)
(for some reason i cant do delInput and addInput symbol)
instead of
@addInput
do
@</span>addInput
ok, fixed.
hi, im wondering why this looks like an old version of scratch, i use scraqcth i used to use this, scratch is like an upgrade of this, scratch.mit.edu