Display score while camera is being controlled
EpicoreGames
Member Posts: 188
I have my main actor controlling the camera and it will keep moving towards right hand-side . But i want to add an actor which will display score that increase by 1 every second. But i can't find a way to let it stay at the middle top of the screen since my main actor is controlling the camera.
How can make my display score actor stays at the middle top of the screen?
Comments
Put an actor on a non-scrollable layer and make it display the current score. If you don't already know how to make the score work, simple create an index attribute and set a rule that states:
(timer) every 1 second, change attribute myAttribute to myAttribute + 1
www.mbstudios.co | Free Stuff
what do you mean by non-scrollable layer?
ok, so i have created a layer which is non-scrollable but i don't see any option to add actors into it or pull the layer into the scene...
EDIT : i had successfully added my score actor into the non-scrollable layer but when i drag the score actor into the scene , it still won't stay at the middle of the screen as where i had put it before i run the preview ! What had i missed?
@GameSecret Make sure it's in the middle of the camera. If it's outside of it, it won't be controlled.
This tutorial might help:
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
when i drag my score actor into the scene, it still won't stay at the middle of the screen .
Are those the reason why it doesn't work?
http://postimg.org/image/jiic00m61/
http://postimg.org/image/eouvwnr0f/
the score actor is in both the Background and Layer 1
You should only place one copy of the score actor and place it on a non-scrolling layer. Make sure it's in the 'home' area (lower left corner) of the stage.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@jamie_c i have solved the problem but why do i need to place it at the lower left corner ? i placed it at the middle top of the screen and it works .
He is talking about the lower left area of the scene. So if you're on iPad portrait and your scene is 5000x5000 your score still needs to be in the 1024x768 area (home area) since it will scroll wherever the camera is positioned.
Fortuna Infortuna Forti Una
oh thank you for explaining ! @Lovejoy and thanks for you guys' help ! Really appreciated !
P.S. may i know how to mark this thread as answered?
@Lovejoy, thanks. Yes that is exactly what I meant.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page