public SampleScreen1(ContentManager globalContent, UIScreenService uiScreenService) : base("Content/UI/Screens/SampleScreen1", "SampleScreen1", globalContent) { Contract.Require(uiScreenService, "uiScreenService"); IsOpaque = true; this.uiScreenService = uiScreenService; this.font = LocalContent.Load <SpriteFont>("SegoeUI"); this.blankTexture = GlobalContent.Load <Texture2D>(GlobalTextureID.Blank); this.textRenderer = new TextRenderer(); }
protected override void Initialize() { FlatRedBallServices.InitializeFlatRedBall(this, graphics); CameraSetup.SetupCamera(SpriteManager.Camera, graphics); CustomPreGlobalContentInitialize(); GlobalContent.Initialize(); LocalizationManager.CurrentLanguage = 1; CustomInitialize(); FlatRedBall.Screens.ScreenManager.Start(typeof(GlueTestProject.Screens.FirstScreen)); base.Initialize(); }
private void PlayTypingSoundEffect() { if (lastTypePlayAttemptSuccessful) { lastTypeSoundEffectNumber = FlatRedBallServices.Random.Next(1, 6); } var soundType = "TypewriterKey"; var stringName = $"{soundType}{lastTypeSoundEffectNumber}Sound"; var soundEffectAsObject = GlobalContent.GetFile(stringName); if (soundEffectAsObject is SoundEffect soundEffect) { lastTypePlayAttemptSuccessful = SoundManager.PlayIfNotPlaying(soundEffect, soundType); } }
private void TestAchxReloading() { var animationChain = GlobalContent.EmptyAnimationForReload; animationChain.Count.ShouldBe(0); animationChain.Add(new AnimationChain()); animationChain.Count.ShouldBe(1); GlobalContent.Reload(GlobalContent.EmptyAnimationForReload); var reloaded = GlobalContent.EmptyAnimationForReload; reloaded.Count.ShouldBe(0); }
public LoadingScreen(ContentManager globalContent, UIScreenService uiScreenService) : base("Content/UI/Screens/LoadingScreen", "LoadingScreen", globalContent) { Contract.Require(uiScreenService, "uiScreenService"); this.uiScreenService = uiScreenService; this.textRenderer = new TextRenderer(); this.blankTexture = GlobalContent.Load <Texture2D>(GlobalTextureID.Blank); this.font = GlobalContent.Load <SpriteFont>(GlobalFontID.SegoeUI); this.spinnerSprite = LocalContent.Load <Sprite>("Spinner"); this.loader = new AsynchronousContentLoader(); this.textRenderer.LayoutEngine.RegisterIcon("spinner", spinnerSprite[0]); UpdateMessage(String.Empty); }
protected override void Initialize() { #if IOS var bounds = UIKit.UIScreen.MainScreen.Bounds; var nativeScale = UIKit.UIScreen.MainScreen.Scale; var screenWidth = (int)(bounds.Width * nativeScale); var screenHeight = (int)(bounds.Height * nativeScale); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; #endif FlatRedBallServices.InitializeFlatRedBall(this, graphics); GlobalContent.Initialize(); CameraSetup.SetupCamera(SpriteManager.Camera, graphics); FlatRedBall.Screens.ScreenManager.Start(typeof(SpaceGame.Screens.StartMenu)); base.Initialize(); //Template to create empty save save1.Data.m1p1_2 = false; save1.Data.m1p1_3 = false; save1.Data.m1p3_4 = false; save1.Data.m1p3_5 = false; save1.Data.m1p5_6 = false; save1.Data.m1p2_6 = false; save2.Data.m1p1_2 = false; save2.Data.m1p1_3 = false; save2.Data.m1p3_4 = false; save2.Data.m1p3_5 = false; save2.Data.m1p5_6 = false; save2.Data.m1p2_6 = false; save2.Data.m1p1_2 = false; save2.Data.m1p1_3 = false; save2.Data.m1p3_4 = false; save2.Data.m1p3_5 = false; save2.Data.m1p5_6 = false; save2.Data.m1p2_6 = false; save1.Load(); save2.Load(); save3.Load(); }
protected override void Initialize() { #if IOS var bounds = UIKit.UIScreen.MainScreen.Bounds; var nativeScale = UIKit.UIScreen.MainScreen.Scale; var screenWidth = (int)(bounds.Width * nativeScale); var screenHeight = (int)(bounds.Height * nativeScale); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; #endif FlatRedBallServices.InitializeFlatRedBall(this, graphics); GlobalContent.Initialize(); FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point; CameraSetup.SetupCamera(SpriteManager.Camera, graphics); Type startScreenType = typeof(FishStory.Screens.TitleScreen); var commandLineArgs = Environment.GetCommandLineArgs(); if (commandLineArgs.Length > 0) { var thisAssembly = this.GetType().Assembly; // see if any of these are screens: foreach (var item in commandLineArgs) { var type = thisAssembly.GetType(item); if (type != null) { startScreenType = type; break; } } } if (startScreenType != null) { FlatRedBall.Screens.ScreenManager.Start(startScreenType); } GeneratedInitialize(); base.Initialize(); }
protected override void Initialize() { #if IOS var bounds = UIKit.UIScreen.MainScreen.Bounds; var nativeScale = UIKit.UIScreen.MainScreen.Scale; var screenWidth = (int)(bounds.Width * nativeScale); var screenHeight = (int)(bounds.Height * nativeScale); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; #endif FlatRedBallServices.InitializeFlatRedBall(this, graphics); CameraSetup.SetupCamera(SpriteManager.Camera, graphics); GlobalContent.Initialize(); FlatRedBall.Screens.ScreenManager.Start(typeof(GlueView2.Screens.MainScreen)); base.Initialize(); }
protected override void Initialize() { #if IOS var bounds = UIKit.UIScreen.MainScreen.Bounds; var nativeScale = UIKit.UIScreen.MainScreen.Scale; var screenWidth = (int)(bounds.Width * nativeScale); var screenHeight = (int)(bounds.Height * nativeScale); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; #endif FlatRedBallServices.InitializeFlatRedBall(this, graphics); IsMouseVisible = true; Window.AllowUserResizing = true; CameraSetup.SetupCamera(SpriteManager.Camera, graphics); GlobalContent.Initialize(); FlatRedBall.Screens.ScreenManager.Start(typeof(BrakeNeck.Screens.MainMenu)); base.Initialize(); }
protected override void Initialize() { #if IOS var bounds = UIKit.UIScreen.MainScreen.Bounds; var nativeScale = UIKit.UIScreen.MainScreen.Scale; var screenWidth = (int)(bounds.Width * nativeScale); var screenHeight = (int)(bounds.Height * nativeScale); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; #endif FlatRedBallServices.InitializeFlatRedBall(this, graphics); FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point; SpriteManager.OrderedSortType = SortType.ZSecondaryParentY; CameraSetup.SetupCamera(SpriteManager.Camera, graphics); GlobalContent.Initialize(); FlatRedBall.Screens.ScreenManager.Start(typeof(Teotihuacan.Screens.Level1)); base.Initialize(); }
/// <summary> /// UnloadContent will be called once per game and is the place to unload /// game-specific content. /// </summary> protected override void UnloadContent() { Primitives2D.Unload(); GlobalContent.Unload(); }