Report as inappropriate.
This is a showcase of my UI elements for Greenfoot. Try them out below!
HOW TO REUSE:
The elements are all inside of my "ui" package. To access it, go to your downloads folder and open the folder "UI demo" that was downloaded with the gfar. It contains a folder "packages", which includes most of my custom stuff, including the ui and vectors, which are needed, too. To use it in a programm, there are two options:
Quick: Copy the folder into the folder of your scenario. It can be used now by writing "import packages.ui.*" at the very top. This has to be done for every of your scenarios.
Longtime-solution: Zip the packages folder. Then put it into "C:/programs/Greenfoot/lib/userlib/". The location may differ if from your install location. Now you can use this from any scenario!
Button - Can be pressed, can call a function or switch to a different world when pressed. Uses simple click animation. Can be coloured like most other elements, too.
Switch - A button that saves its state and displays it in a colour. Can call functions, too.
Slider - Select a value in the selected range by pulling the handle. Can be set to only allow integer values.
Drop-down menu - Click to select between a list of options, or go back to the default option. Can call methods depending on the selection and return the current selection (and if it's the default value).
Text - A simple text display that looks a bit better than the "showText"-function from World. Background and letter colour can be changed.
UIPlane - A plane to put the UI elements on. Uses fractions to save where elements on the plane are to scale them when being scaled. Can have a colour or can be transparent. Can also hold any other actors.
UIWorld - Similar to the UIPlane, it saves the location of objects as fractions. Allows to easily modify the worlds size without having to redo the UI positioning. It can save locations as pixel location as well. Extend from this to modify the world.
The online version does not display the animations correctly. They are nicer if you open this in real Greenfoot!
1101 views / 511 in the last 7 days
1 vote | 0 in the last 7 days
This scenario is a member of: Reusable actors & support classes
To embed this scenario in a web page, copy the following HTML code:
Want to leave a comment? You must first log in.