This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

SPower
SPower presents ...

2012/6/28

Scrolling

I have programmed a scrolling actor, which lets you scroll over a big image. I call that class ScrollView. I also added a List class, and if you put that in a scroll view, you get a very useful result.

The scroll view on the left is one to show how to use it with an image, and the one on the right is a demo of a scroll view with a list in it. The cells inside the list can be fully customized.

Look in the documentation of the classes how to use them

6853 views / 26 in the last 7 days

7 votes | 0 in the last 7 days

Tags: mouse with-source scrolling scroll list cells

This scenario is a member of: Reusable actors & support classes, Scrolling games


open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Fri Jun 29 14:21:55 UTC 2012 Really small bug fix.
A new version of this scenario was uploaded on Mon Jul 02 09:35:12 UTC 2012 -Fixed bugs -Renamed List to ListView, because it was is a real pain if you want to use this List along with the List datatype (java.util.List)
-nic--nic-

2012/7/2

NIce!
SPowerSPower

2012/7/2

@-nic- Thanks! And, can you click 'like' please?
USBestUSBest

2012/7/3

Well done! It would be much better, if you would add, that you can scroll with the mousewheel, too! :)
SPowerSPower

2012/7/3

I'll take a look at it.
SPowerSPower

2012/7/3

I don't think that's possible with greenfoot, but it's possible with other IDEs
SPower, take a look at this scenario: http://www.greenfoot.org/scenarios/2828
Busch2207Busch2207

2013/1/4

Maybe take a look at the documentation of the 'Mouse'-class in this scenario: http://www.greenfoot.org/scenarios/3438 The class can help you to add a scrolling with the mouse wheel! :)
SPowerSPower

2013/1/4

Well, I've already tried it some time ago, but it seems there's a bug in the scroll bar class I'm using, and I guess I won't have time to look at it the coming time.

See all comments

Want to leave a comment? You must first log in.

Who likes this?

Entity1037 FlyingRabidUnicornPig USBest -nic- darkmist255 Denzien erdelf