This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-09-24 15:41:15

Slacker101
Scratcher
Registered: 2007-07-23
Posts: 60

Drop down menu?

Any projects that has one or a way to make one?

Offline

 

#2 2009-09-25 18:17:43

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: Drop down menu?

Here's a project with a drop down menu. http://scratch.mit.edu/projects/scmb1/632583

Last edited by scmb1 (2010-01-02 17:06:30)


http://i48.tinypic.com/2z5pqad.png

Offline

 

#3 2009-10-04 17:50:55

NXTGeek
Scratcher
Registered: 2008-03-27
Posts: 100+

Re: Drop down menu?

I've often wondered how to effectively do this. I'll look at that project also.

Offline

 

#4 2009-10-04 19:37:04

floppy_gunk
Scratcher
Registered: 2008-11-14
Posts: 500+

Re: Drop down menu?

This project contains a drop down menu: Virtual Mac


http://img163.imageshack.us/img163/1917/2856lg.jpg Get it now!  smile

Offline

 

#5 2009-10-04 19:40:10

floatingmagictree
Scratcher
Registered: 2008-10-21
Posts: 1000+

Re: Drop down menu?

It's really as simple as putting a few broadcasts and a few extra sprites and scripts.

Offline

 

#6 2009-10-04 20:23:09

Midmad
Scratcher
Registered: 2009-06-21
Posts: 2

Re: Drop down menu?

To make a drop-down menu:

Make a sprite that the drop-down menu comes from.
Then, make some more sprites that stack on top of each other with the stuff you want in the drop-down menu.

Then, make these scripts:

Sprite where drop-down menu comes from:
Script 1:
[blocks]
<when green flag clicked>
<forever>
<if><touching[ mouse-pointer
<broadcast[ whatever
<end>
<if>  <<not> <<touching[ mouse-pointer
<broadcast[ whenever
<end>
[/blocks]

For pieces of drop-down menu:
Script 1:
[blocks]
<when green flag clicked>
<hide>
[/blocks]
Script 2:
[blocks]
<when I receive[ whatever
<show>
[/blocks]
Script 3:
[blocks]
<when I receive[ whenever
<hide>
[/blocks]

Last edited by Midmad (2009-10-04 20:28:02)


http://images3.wikia.nocookie.net/uncyclopedia/images/c/cf/Developers.gif
Developers, developers, developers, developers!

Offline

 

#7 2009-11-08 21:33:36

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Drop down menu?

Or you could make a single sprite that stamps the options when expanded and clears when collapsed.  More complicated and difficult but it helps avoid having too many sprites.
[blocks]
<when[ Menu sprite ]clicked>
<if><( Costume # <=> 1 )>
<next costume>
<stamp>
<repeat( whatever number of options there are)
<next costume>
<change y by( varies on size of menu things)
<stamp>
<end>
<go to x sad  whatever the original x position was )y sad  whatever the original y position was)
<switch to costume[ expanded]
<else>
<clear>
<switch to costume[ collapsed]
<go to x sad  whatever the original x position was )y sad  whatever the original y position was)
<end>
[/blocks]
You'll also need scripts so that Scratch can detect when the mouse is on each menu option and clicked.  Something like if the mouse's x and y position is within certain parameters, if mouse down, wait until not mouse down, broadcast whatever.
Hope this helps.

Last edited by Harakou (2009-11-08 21:36:51)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#8 2009-11-08 21:39:17

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Drop down menu?

AddZero has a really good dropdown menu.

http://scratch.mit.edu/projects/AddZero/134975

Last edited by Lucario621 (2009-11-08 21:40:02)


http://i.imgur.com/WBkM2QQ.png

Offline

 

Board footer