public Controler(GameWindow gameWindow, Dictionary <string, SpriteFont> Fonts, List <Sprite> sprites, GraphicsDeviceManager Graphics, ContentManager content, SpriteBatch spriteBatch, Vector2 Bounds) { ScripterManager.InstanceCreated += OnScripteManagerCreation; IsTextInputBoxFocused = false; action = new List <Action <object> >(); actionArg = new List <object>(); KeyboardUtils = new KeyboardUtils(); RenderManager = new RenderManager(sprites, Graphics, spriteBatch); TextureManager = new TextureManager(Graphics, content, spriteBatch, RenderManager, Fonts); DebugManager = new DebugManager(TextureManager, Fonts, Graphics); Terminal = new Terminal(TextureManager.CreateTexture(700, 30, paint => Color.Black), Fonts["Default"], this) { Position = new Vector2(0, 185) }; NetworkManager = new NetworkManager(this, Terminal); window = gameWindow; window.TextInput += OnTextInput; KeyboardUtils.KeyPressed += DebugManager.AddEvent; KeyboardUtils.KeyRealeased += DebugManager.AddEvent; this.Bounds = Bounds; _sprites = sprites; this.Fonts = Fonts; graphics = Graphics; Camera = new Camera(new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight)); TerminalTexintput = new TextinputBox(TextureManager.CreateTexture(700, 35, paint => Color.Black * .8f), Fonts["Default"], KeyboardUtils, true) { IsHUD = true, Position = new Vector2(0, 695), Opacity = 0f, }; TerminalTexintput.Validated += Terminal.OnTextinputValidation; MousePointer = new MousePointer(TextureManager.LoadTexture("cursor")); _sprites.Add(Terminal); _sprites.Add(TerminalTexintput); _sprites.Add(MousePointer); ScripterManager.Instance.CreateMenu(); InitKeyEvent(); }
public TextureManager(GraphicsDeviceManager Graphics, ContentManager content, SpriteBatch spriteBatch, RenderManager renderManager, Dictionary <string, SpriteFont> fonts) { this.fonts = fonts; LoadedTextures = new Dictionary <string, Texture2D>(); Content = content; this.renderManager = renderManager; graphics = Graphics; this.spriteBatch = spriteBatch; }