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

2019/5/5

Overlay (HUD) in Scrolling World

Syes Syes

2019/5/5

#
Hey, I´m using danpost ImageScrollWorld (https://www.greenfoot.org/scenarios/19020) to move my Player around . My Problem is that I want tow Actors (e.g. Health & Mana Bar) to be on screen and unaffected by the scrolling. I tried to create a subclass as "Overlay" of the ImageScrollWorld and place my Actors on that but that did not work for me. Can someone point me in the right direction? Thanks in advance.
danpost danpost

2019/5/6

#
Syes wrote...
Hey, I´m using danpost ImageScrollWorld (https://www.greenfoot.org/scenarios/19020) to move my Player around . My Problem is that I want tow Actors (e.g. Health & Mana Bar) to be on screen and unaffected by the scrolling. I tried to create a subclass as "Overlay" of the ImageScrollWorld and place my Actors on that but that did not work for me. Can someone point me in the right direction?
Just place the following line in the Health and ManaBar classes:
public void setLocation(int x, int y) {}
To effectively prevent them from being moved.
You need to login to post a reply.