Label position

Oct 9, 2011 at 8:25 PM


Just tried using a label and it always seems to be set at (0,0). Not sure if I'm using it correctly or not, so I thought I'd post here just incase.

           label = new Label("Fonts/hudFont", "Label 1");
            label.LoadContent(Application.GameState.Content, Application.ContentManager);
            label.X = 100;
            label.Y = 400;
            label.TextColor = Color.Red;

I put the Refresh() call in incase it wasn't updating after setting the X and Y positions, but it still always renders in the top left corner, as if it was at 0,0. Is there anything else I need to do, maybe create a container for them, like a canvas?

Loving IGF so far, thanks!

Oct 9, 2011 at 8:36 PM

Nevermind, it was just me missing something.

Added the GuiManager, then added a screen and the label to the screen and all works well!

I'm figuring it out slowly.