public void StartGame(IGame game) { //Rendering the text at a 4 time higher resolution than the actual game, so it will still look sharp when maximizing the window. GLText.TextResolutionFactorX = 4; GLText.TextResolutionFactorY = 4; game.Events.OnLoad.Subscribe(async() => { game.Factory.Resources.ResourcePacks.Add(new ResourcePack(new FileSystemResourcePack(AGSGame.Device.FileSystem), 0)); game.Factory.Resources.ResourcePacks.Add(new ResourcePack(new EmbeddedResourcesPack(AGSGame.Device.Assemblies.EntryAssembly), 1)); game.Factory.Fonts.InstallFonts("../../Assets/Fonts/pf_ronda_seven.ttf", "../../Assets/Fonts/Pixel_Berry_08_84_Ltd.Edition.TTF"); AGSGameSettings.DefaultSpeechFont = game.Factory.Fonts.LoadFontFromPath("../../Assets/Fonts/pf_ronda_seven.ttf", 14f, FontStyle.Regular); AGSGameSettings.DefaultTextFont = game.Factory.Fonts.LoadFontFromPath("../../Assets/Fonts/Pixel_Berry_08_84_Ltd.Edition.TTF", 14f, FontStyle.Regular); AGSGameSettings.CurrentSkin = null; game.State.RoomTransitions.Transition = AGSRoomTransitions.Fade(); setKeyboardEvents(game); Shaders.SetStandardShader(); addDebugLabels(game); Debug.WriteLine("Startup: Loading Assets"); await loadPlayerCharacter(game); Debug.WriteLine("Startup: Loaded Player Character"); await loadSplashScreen(game); }); }
public static void Run() { IGame game = AGSGame.CreateEmpty(); _gameDebugView = new Lazy <GameDebugView>(() => { var gameDebugView = new GameDebugView(game); gameDebugView.Load(); return(gameDebugView); }); //Rendering the text at a 4 time higher resolution than the actual game, so it will still look sharp when maximizing the window. GLText.TextResolutionFactorX = 4; GLText.TextResolutionFactorY = 4; game.Events.OnLoad.Subscribe(async() => { game.Factory.Fonts.InstallFonts("../../Assets/Fonts/pf_ronda_seven.ttf", "../../Assets/Fonts/Pixel_Berry_08_84_Ltd.Edition.TTF"); AGSGameSettings.DefaultSpeechFont = game.Factory.Fonts.LoadFontFromPath("../../Assets/Fonts/pf_ronda_seven.ttf", 14f, FontStyle.Regular); AGSGameSettings.DefaultTextFont = game.Factory.Fonts.LoadFontFromPath("../../Assets/Fonts/Pixel_Berry_08_84_Ltd.Edition.TTF", 14f, FontStyle.Regular); AGSGameSettings.CurrentSkin = null; game.State.RoomTransitions.Transition = AGSRoomTransitions.Fade(); setKeyboardEvents(game); Shaders.SetStandardShader(); addDebugLabels(game); Debug.WriteLine("Startup: Loading Assets"); await loadPlayerCharacter(game); Debug.WriteLine("Startup: Loaded Player Character"); await loadSplashScreen(game); }); game.Start(new AGSGameSettings("Demo Game", new AGS.API.Size(320, 200), windowSize: new AGS.API.Size(640, 400), windowState: WindowState.Normal)); }