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

2017/11/22

Part view of a large picture

Yogibaer Yogibaer

2017/11/22

#
Hey everybody, I want to create a car racing. My idea: I have a very large image (3000 x 2000 pixel) of the racing cours. The world has the same size but only a part of it can be seen (because my monitor is to small). In the moment, when I reach the end of the shown part of the world with my car I have to move the window selection bars to move the visible part to a new position. Question: Are there any commands to move the bars from the program code? or : My car is fixed in the window (world) positioned in the middle and one third from bottom and the image slides under it. (in all directions and also turned arround to follow curves) Thanks for all advices. kind regards Yogibaer
Super_Hippo Super_Hippo

2017/11/22

#
You could try to create a scrolling world. There are several ones around here that you can try.
danpost danpost

2017/11/22

#
Yogibaer wrote...
Are there any commands to move the bars from the program code?
No. But you can make your world smaller to fit the monitor size and scroll the background image using program code.
when I reach the end of the shown part of the world with my car I have to move the window selection bars to move the visible part to a new position.
That basically describes what a scrolling world does. It allows the viewport to shift so that any part of a larger than viewport world can be made visible at any one time. I have a written both a scrolling tutorial as well as a Scroller class demo scenario.
You need to login to post a reply.