ScratchData LogoScratchData
Back to AddZero's profile

gui- combo box calculator

ADAddZero•Created April 5, 2008
gui- combo box calculator
42
35
912 views
View on Scratch

Description

This project does math based on selections in the combo boxes. Just click them to change the values. Combo boxes are selectors you often see in website forms and applications. They make it easy to select information. I made this combo box for a tutorial system and other projects I'm working on. I wanted it to be all-in-one so it's easy to drop into projects. It's pretty easy to modify, just change the costumes. If you change the number of choices or location, change the values above the script then double-click to run it. -----Feel free to use this in your projects. Please let me know if you improve it HOW IT WORKS: Everything is in one sprite. There are costumes for each of the options, There's also a check-mark and a blue selection highlight costume. When clicked, it stamps so that the current option stays at the bottom, then it moves up, changes costumes and stamps for each of the options. So that it draws all of the options. then moves to and stamps a check mark at the current selection. The sprite then changes to the blue highlight, and turns on the ghost effect so it's partially transparent. While the cursor is still over the menu, it moves at 16px increments up and down. so that it highlights an option. If the blue selection costume is clicked, it changes the "value" variable of the combo box to the current selection and broadcasts "changed" When the combo box is done, it clears the screen. For the calculator: There's a script waiting for the "changed" broadcast. When it receives that, it does the math based on the values in the combo boxes. KNOWN ISSUES: If you move your mouse far after clicking, it can break or select the wrong thing. It's hard coded to 16 pixels tall. Because it stamps the menu, it will be behind objects in the way. Some of the code is hackish, I don't know the cleanest/best way to do it. I've never done this before! I'm open to suggestions!

Project Details

Project ID134975
CreatedApril 5, 2008
Last ModifiedApril 5, 2008
SharedApril 5, 2008
Visibilityvisible
CommentsAllowed