void InitializeGui() { GuiRenderer = new GwenRenderer(); var textureName = "DefaultSkin.png"; var defaultFont = new Font("Vera.ttf", 16); var resMan = Engine.GetEngine().ResourceManager; var options = new ResourceLoadOptions {Name = textureName, AsynchronousLoad = false}; var imageHandle = resMan.LoadResource<Image>(options); if (imageHandle.Id == 0) throw new Exception("Could not load GUI texture: " + textureName); Skin = new TexturedSkin(GuiRenderer, imageHandle, defaultFont); Canvas = new Canvas(Skin); Input = new GwenInput(Engine.GetEngine().InputManager); Input.Initialize(Canvas); }
void InitializeGui() { GuiRenderer = new GwenRenderer(); var textureName = "DefaultSkin.png"; var defaultFont = new Flood.GUI.Font("Vera.ttf", 16); var resMan = FloodEngine.GetEngine().ResourceManager; var options = new ResourceLoadOptions {Name = textureName, AsynchronousLoad = false}; var imageHandle = resMan.LoadResource<Image>(options); if (imageHandle.Id == 0) return; var skin = new TexturedSkin(GuiRenderer, imageHandle, defaultFont); Canvas = new Canvas(skin); var container = new Container(Canvas); var paneGroup = new PaneGroup(container); container.InsertPanel(paneGroup); paneGroup.AddPane(new Pane { Title = "PANE1" }); paneGroup.AddPane(new Pane { Title = "PANE2" }); Input = new GwenInput(FloodEngine.GetEngine().InputManager); Input.Initialize(Canvas); }