//void GraphicsDeviceCreated(object sender, System.EventArgs e) //{ // Engine engine = new MonoGameEngine(GraphicsDevice, GraphicsDevice.DisplayMode.Width, GraphicsDevice.DisplayMode.Height); //} //private void GetUIElements() //{ // EmptyKeys.UserInterface.Input.InputManager -> throwing null, that my issue? // var elements = // Assembly.GetExecutingAssembly() // .GetTypes() // .Where(t => t.Namespace == "EmptyKeys.UserInterface.Generated") // .ToList(); // ; // UIElements = elements; // //var actorActions = UIElements.Where(e => e.Name == "ActorActions").First(); // //Type type = Type.GetType("EmptyKeys.UserInterface.Generated.ActorActions"); // //var instance = Activator.CreateInstance(type); //} /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { Font = Content.Load <SpriteFont>("General"); //FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(Font); //ActorActions = new EmptyKeys.UserInterface.Generated.ActorActions(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); //FontManager.Instance.LoadFonts(Content); //static constructor?? :TODO Drawable.GraphicsDevice = GraphicsDevice; Drawable.Sb = SpriteBatch; Drawable.Font = Font; Drawable.Camera = GameCamera; Drawable.Font = Font; #region load static UI Textures Hex.HighlightedTexture = Content.Load <Texture2D>(@"UIElements\yellowTransparentHex"); Hex.SelectedTexture = Content.Load <Texture2D>(@"UIElements\yellowSelecthex"); //ActorRotateClockWise.Texture = Content.Load<Texture2D>(@"UIElements\rotateClockWise"); //ActorRotateCounterClockWise.Texture = Content.Load<Texture2D>(@"UIElements\rotateCounterClockWise"); //ActorMoveAction.Texture = Content.Load<Texture2D>(@"UIElements\move"); #endregion string ModulesDir = Environment.CurrentDirectory + @"\Modules\"; DirectoryInfo dirInfo = new DirectoryInfo(ModulesDir); List <DirectoryInfo> modules = dirInfo.GetDirectories().ToList(); foreach (var module in modules) { var moduleFullPathName = ModulesDir + module.Name; var loadedModule = new LoadModule(moduleFullPathName); Modules.Add(loadedModule); } var usedModule = Modules[0]; var hexMap = new HexGrid.HexGrid(usedModule.LoadedMaps, usedModule.LoadedBackgroundTiles, usedModule.LoadedActors, usedModule.ModuleName); //:TODO iterative to for multimodules ActionHandler.ActionsList = usedModule.LoadedActions; BoardState = new HexBoardState(hexMap, GameCamera); //FileStream fs = new FileStream(@"Content/greenhex.png", FileMode.Open); //Texture2D background1 = Texture2D.FromStream(GraphicsDevice, fs); //fs.Dispose(); //get sizes from sprite or scale it //HexMap = new HexGrid(2, 2, 100, 100, TileTextures[0]); graphics.ApplyChanges(); }
//property for how many elements will share line with, counting self? //public int ShareLine { get; set; } protected UIDrawable(HexGrid.HexGrid hexGrid) { HexGrid = hexGrid; }