//-------------------------------------------------------------------------------------
        // Class constructors

        public PlanetObject(BenchmarkGame game, Vector2 position, Texture2D texture, float size)
            : base(game, position, texture)
        {
            // Set the origin to the center of the planet
            Origin = new Vector2(texture.Width / 2, texture.Height / 2);
            Scale  = new Vector2(size, size);
        }
예제 #2
0
        // Constructor
        public GamePage()
        {
            InitializeComponent();

            _game = XamlGame <BenchmarkGame> .Create("", this);

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }
        //-------------------------------------------------------------------------------------
        // Class constructors

        public MoonObject(BenchmarkGame game, Texture2D texture, SpriteObject targetObject, float speed, float distance, float size, Color color)
            : base(game, Vector2.Zero, texture)
        {
            // Apply the constructor parameters
            _targetObject = targetObject;
            _speed        = speed;
            _distance     = distance;
            Scale         = new Vector2(size, size);
            SpriteColor   = color;
            // Set the origin to the center of the moon
            Origin = new Vector2(texture.Width / 2, texture.Height / 2);
        }