Frustrating problem with HUD in platformer

thdgamesthdgames Member Posts: 9
edited November -1 in Working with GS (Mac)
Hi,
I'm modifying the platformer tutorial and I have run into a problem displaying a HUD. I have followed the tutorial on youtube by Weswog and I've done this loads of times now.

Just to make sure I wasn't going crazy I've created a new blank game also and threw in some actors and the HUD works for me in that as i scroll along - so I know I'm doing it correctly.

Can anybody give possible reasons why the HUD actors (2 x 30px square icons won't appear at all? - they are there in the game, but disappear when I preview. This must be a simple fix? HELP!!

thanks,
T

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Are you placing all your HUD elements in a non-scrollable layer at the bottom left corner of your scene. i.e. They do not stick to where you initially move the camera origin.
  • thdgamesthdgames Member Posts: 9
    Hi CodeMonkey,
    Thanks for the reply, at the moment I have just got an actor called 'HUD Lives' which is a small rectangle. I want it to appear at the top right hand corner of the camera as part of the HUD. I have the correct non-scrollable layer above 'moving parts' layer and 'Background layer'.

    I have placed the 'HUD lives' actor where i want it, so it's there in the construction window, but when I hit preview, it's vanished.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Is that "Construction Window" starting at the lower left of the scene? (Because its not a construction window, its the camera view)
  • thdgamesthdgames Member Posts: 9
    ah... okay, I've just discovered that I must start with the camera set to the bottom left of the screen - that makes absolutely no sense to me, but hey it works! - thanks CodeMonkey, by the way... now that I have your expertise at hand...

    I created an animated character with 8 'right states' and 8 'left states' - it works well. Only problem is it starts facing left and on the 2nd frame of the animation. I'd like it to start at the first frame right-facing.

    Is it possible to control which frame the character starts on?

    cheers,
    T
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    You don't need to start your camera at the bottom left of the screen, just all of the hud elements need to be put in that area. During the game the camera position may move around, but the HUD elements always have their position relative to 0,0.

    Check your otherwise rules on when things get activated for animation.
Sign In or Register to comment.