public static void InitializeGame() { VideoSettings.InitVideoSettings(); //VideoSettings.SetFullscreen(); VideoSettings.SetWindowed(); VideoSettings.SetResolution(1280, 800); camera = new Camera(VideoSettings.GetResolution().X, VideoSettings.GetResolution().Y); game.IsMouseVisible = true; drawableGameObjects = new List <DrawableObject>(); drawableUIObjects = new List <DrawableUIObject>(); gridLayout = new Layout(Layout.flat, new Vector2(30, 30), new Vector2(128, 128)); hexGrid = new Grid(game, 10, 10); player1 = new Player(1, "Denis"); player2 = new Player(2, "Turner"); player1.startTurn(); testUnit = new Unit(game, Unit.infantry, player1); testUnit.PlaceUnit(0, 0, 0); testUnit2 = new Unit(game, Unit.cavalry, player2); testUnit2.PlaceUnit(5, 5, -10); testUnit3 = new Unit(game, Unit.artillery, player2); testUnit3.PlaceUnit(7, 7, -14); UnitManager.SetCurrentUnit(testUnit); UIManager.DrawUI(); }
public static void DrawUI() { /* Turn display */ turnDisplay = new BoxUIElement(GameManager.game); turnDisplay.Resize(300, 50); turnDisplay.SetPosition(Vector2.Zero); turnDisplay.BackgroundColor = Color.LightSlateGray; turnDisplayText = new TextUIElement(GameManager.game, FontManager.B15(GameManager.game), turnDisplay); turnDisplayText.AlignWithParent(); /* Unit info */ unitInfo = new BoxUIElement(GameManager.game); unitInfo.Resize(150, 200); unitInfo.SetPosition(new Vector2( 0, VideoSettings.GetResolution().Y - unitInfo.height)); unitInfo.BackgroundColor = Color.LightSlateGray; unitInfoHeader = new TextUIElement(GameManager.game, FontManager.B15(GameManager.game), unitInfo); unitInfoHeader.AlignWithParent(); unitInfoHeader.Text = "Current unit"; unitInfoText = new TextUIElement(GameManager.game, FontManager.B15(GameManager.game), unitInfo); unitInfoText.AlignWithParent(); unitInfoText.ApplyOffset(new Vector2(0, 30)); }