public ImGuiGameComponent(Game game, StatisticsProfiler statisticsProfiler) : base(game) { _statisticsProfiler = statisticsProfiler; _renderer = new ImGUIRenderer(game).Initialize().RebuildFontAtlas(); Console.SetOut(new ConsoleInterceptorWriter(_consoleItems, Console.Out)); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here Window.AllowUserResizing = true; IsMouseVisible = true; // world map = new Map(initialMapWidth, initialMapHeight, CreateNoise2D(noiseSettings)); map.TileSize = 32; // character player1.Position = new Vector2(map.Width * tileSize / 2, map.Height * tileSize / 2); player1.MoveSpeed = 4f; player1.Name = "Left of Zen"; // entities animals = new List <Animal>(); // player pet doggy var pet = new Animal { Position = player1.Position, MoveSpeed = 3f, Name = "Fluffy", AnimalType = AnimalType.Dog }; pet.Behaviours.Add(new FollowBehaviour { Target = player1 }); animals.Add(pet); //var animalCount = 20; //for (var i = 0; i < animalCount; i++) //{ // var rnd = rand.Next(1, 3); // var type = (AnimalType)rnd; // animals.Add(new Animal // { // Position = player1.Position + new Vector2(rand.Next(-1024, 1024), rand.Next(-1024, 1024)), // MoveSpeed = 4f, // Name = $"{type}-{i}", // AnimalType = type // }); //} // camera camera = new Camera(GraphicsDevice.Viewport); // input previousMouseState = Mouse.GetState(); base.Initialize(); // ui GuiRenderer = new ImGUIRenderer(this).Initialize().RebuildFontAtlas(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here Window.AllowUserResizing = true; IsMouseVisible = true; //map var rnd = new Random(); for (int y = 0; y < mapHeight; y++) { for (int x = 0; x < mapWidth; x++) { map[x, y] = rnd.Next(484); } } previousMouseState = Mouse.GetState(); base.Initialize(); GuiRenderer = new ImGUIRenderer(this).Initialize().RebuildFontAtlas(); }