コード例 #1
0
 public Laboration1()
 {
     camera = new Camera();
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferWidth = 320;
     graphics.PreferredBackBufferHeight = 240;
     Content.RootDirectory = "Content";
 }
コード例 #2
0
ファイル: Game1.cs プロジェクト: BaltaX/Lab1
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();

            //Testing the Camera class methods
            Camera myCam = new Camera();
            Vector2 myVec = myCam.getViewCoordinatesWhite(0, 0);            //returns {X:64 Y:64}
            Vector2 myVec2 = myCam.getViewCoordinatesBlack(0, 0);           //returns {X:512 Y:512}
            Vector2 myVec3 = myCam.getViewCoordinatesMobileWhite(0, 0);     //returns {X:24 Y:24}
        }