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

#1 2008-04-05 01:14:11

AddZero
Scratcher
Registered: 2007-08-11
Posts: 100+

gui elements- combo box

I couldn't find a combo box sprite I wanted for some projects.  So after too much tinkering, I made one.  http://scratch.mit.edu/projects/AddZero/134975

But, I've never done this before.
I'd like it to be even easier to customize and drop into projects.  It's fixed at 16px tall for example.  I struggled with some of the code/math.  I'm sure it could be done better.
Feel free to use and improve this, or offer suggestions.

Perhaps once it's in proper shape it can be part of a gui library?


http://scratch.mit.edu/static/icons/buddy/524717_med.png?t=2010-06-15+09%3A48%3A36

Offline

 

#2 2008-04-06 11:41:15

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: gui elements- combo box

I took a look at your code, and it's pretty amazing. I'm not sure if it would be possible to attach a combobox to a moving object (like a window) because of the use of the stamp feature. I'm going to try, though.

Comboboxes are probably the hardest GUI element to implement in Scratch, and with your code I'm going to try to create a full GUI system for Scratch.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#3 2008-04-07 23:04:22

AddZero
Scratcher
Registered: 2007-08-11
Posts: 100+

Re: gui elements- combo box

Yeah, the stamps will create a problem, any sprites are going to be over the menu, unless you stamp and hide them first.  which would be a mess.

For that I'd make it another way:
Have individual images how you have them now, and make a costume that has the extended menu.  (stamp them up like my current script, then screen grab them,) then have another sprite to handle the highlighting.  That same highlight sprite could be used for all your combobox/menu highlighting... or something.
This would be faster too, just more of a pain to setup.

I think a 'full gui' is possible in scratch.  You've done some awesome progress that direction.  I'd like to have movable numerical outputs and inputs...   That would be tricky.  Would each digit have to be a sprite?


http://scratch.mit.edu/static/icons/buddy/524717_med.png?t=2010-06-15+09%3A48%3A36

Offline

 

#4 2008-04-08 21:54:38

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: gui elements- combo box

Yeah, that's how I generally make non-Scratch variable outputs. I've seen some very efficient one-sprite readouts but they all involve stamping. I'm hoping for one of two things:

A stamp on/draw on block that lets you draw or stamp onto a sprite. The pen marks would then act as if they were part of the sprite's costume.

A block that lets you show, hide, move, and dynamically change variable readouts.

Actually the first one would be considerably better!

Last edited by fullmoon (2008-04-08 21:54:53)


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#5 2008-04-16 21:16:25

Zen
Scratcher
Registered: 2007-04-10
Posts: 21

Re: gui elements- combo box

<point in direction( http://scratch.mit.edu/forums/viewtopic.php?id=4654#req_message)>

Offline

 

#6 2008-04-16 21:17:58

Zen
Scratcher
Registered: 2007-04-10
Posts: 21

Re: gui elements- combo box

<hide variables(

Offline

 

#7 2008-04-16 21:19:24

Zen
Scratcher
Registered: 2007-04-10
Posts: 21

Re: gui elements- combo box

<hide variables>

Offline

 

#8 2008-04-16 21:20:32

Zen
Scratcher
Registered: 2007-04-10
Posts: 21

Re: gui elements- combo box

<stop <key[  ]pressed?>hing color[ ance to[ e x>(  )secsc> sound[ k[  ]for(  )secs>ch to costume[ t>

Offline

 

#9 2008-04-17 18:04:42

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

Re: gui elements- combo box

Well I very much like your combo box thing. I downloaded it, deleted all of the sprites expept for one combo box, and I changed the scripts a bit so then I exported it, and I can have it to use!


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

Offline

 

Board footer