Inheritance: FlxGroup
示例#1
0
 /// <summary>
 /// FlxGame constructor takes in the initial state and resolution of the screen.
 /// </summary>
 /// <param name="State">The state you want to load</param>
 /// <param name="Width">The width of the screen</param>
 /// <param name="Height">The height of the screen</param>
 /// <param name="ContentRootDirectory">The directory of your content.  It is set automatically by default but you can change it if you want to.</param>
 public FlxGame(FlxState State, int Width = 1280, int Height = 720, float Zoom = 1.0f, string ContentRootDirectory = "Content") : base()
 {
     FlxG.state = State;
     FlxG.zoom  = Zoom;
     graphics   = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferWidth  = Width / (int)Zoom;
     graphics.PreferredBackBufferHeight = Height / (int)Zoom;
     graphics.ApplyChanges();
     Content.RootDirectory = ContentRootDirectory;
 }
示例#2
0
 /// <summary>
 /// FlxGame constructor takes in the initial state and resolution of the screen.
 /// </summary>
 /// <param name="State">The state you want to load</param>
 /// <param name="Width">The width of the screen</param>
 /// <param name="Height">The height of the screen</param>
 /// <param name="ContentRootDirectory">The directory of your content.  It is set automatically by default but you can change it if you want to.</param>
 public FlxGame(FlxState State, int Width = 1280, int Height = 720, float Zoom = 1.0f, string ContentRootDirectory = "Content")
     : base()
 {
     FlxG.state = State;
     FlxG.zoom = Zoom;
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferWidth = Width * (int)Zoom;
     graphics.PreferredBackBufferHeight = Height * (int)Zoom;
     graphics.ApplyChanges();
     Content.RootDirectory = ContentRootDirectory;
 }
示例#3
0
 /// <summary>
 /// Call this to switch to a new state
 /// @use  FlxG.switchState(new NewState());
 /// </summary>
 /// <param name="State"></param>
 public static void switchState(FlxState State)
 {
     state.destroy();
     state = State;
     state.create();
 }
示例#4
0
 /// <summary>
 /// Call this to switch to a new state
 /// @use  FlxG.switchState(new NewState());
 /// </summary>
 /// <param name="State"></param>
 static public void switchState(FlxState State)
 {
     state.destroy();
     state = State;
     state.create();
 }