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

2021/10/1

Scenario completely breaks when adding Scrolling SuperWorld

1
2
Gbasire Gbasire

2021/10/4

#
Hello danpost, I have a question regarding the Scroller class, how can I get the X and Y of the actor in the current universe, because getX() and getY() only return the position of the actor in the frame, not in the whole world. Thanks !
danpost danpost

2021/10/4

#
Gbasire wrote...
Hello danpost, I have a question regarding the Scroller class, how can I get the X and Y of the actor in the current universe, because getX() and getY() only return the position of the actor in the frame, not in the whole world. Thanks !
Make use of the getScrolledX and getScrolledY methods of the Scroller class:
int univX = scrollActor.getX() + scroller.getScrolledX();
int univY = scrollActor.getY() + scroller.getScrolledY();
You need to login to post a reply.
1
2