Пример #1
0
        // Constructor
        public GamePage()
        {
            InitializeComponent();

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

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

        public GroundObject(FairyDustGame game, Texture2D texture)
            : base(game)
        {
            // Have we already built the ground vertex array in a previous instance?
            if (_vertices == null)
            {
                // No, so build it now
                BuildVertices();
            }

            // Set other object properties
            ObjectTexture = texture;
        }
        //-------------------------------------------------------------------------------------
        // Class constructors

        public FairyObject(FairyDustGame game, Texture2D texture, float zRotation)
            : base(game)
        {
            _game = game;

            // Have we already built the ground vertex array in a previous instance?
            if (_vertices == null)
            {
                // No, so build it now
                BuildVertices();
                // Create a vertex buffer
                _vertexBuffer = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionNormalTexture), _vertices.Length, BufferUsage.WriteOnly);
                _vertexBuffer.SetData(_vertices);
            }

            // Set object properties
            ObjectTexture = texture;

            _zRotation = zRotation;
        }
        //-------------------------------------------------------------------------------------
        // Class constructors

        public CameraObject(FairyDustGame game)
            : base(game)
        {
        }