public _Billboard(GraphicsDevice device, Game game, string textureName, string texture2Name, Vector3 position, Vector2 size, _WallOrientation orientation)
     : base(device, game, textureName, texture2Name, position, size, orientation)
 {
 }
Пример #2
0
        public _Quad(GraphicsDevice device, Game game, string textureName, string texture2Name, Vector3 position, Vector2 size, _WallOrientation orientation)
        {
            this.game   = game;
            this.device = device;
            this.world  = Matrix.Identity;


            switch (orientation)
            {
            case _WallOrientation.South:
                isSouth(position, size);
                break;

            case _WallOrientation.North:
                isNorth(position, size);
                break;

            case _WallOrientation.East:
                isEast(position, size);
                break;

            case _WallOrientation.West:
                isWest(position, size);
                break;

            case _WallOrientation.Up:
                isUp(position, size);
                break;

            case _WallOrientation.Down:
                isDown(position, size);
                break;
            }

            this.verts = new VertexPositionTexture[]
            {
                new VertexPositionTexture(v0, Vector2.Zero),  //v0
                new VertexPositionTexture(v1, Vector2.UnitX), //v1
                new VertexPositionTexture(v2, Vector2.UnitY), //v2

                new VertexPositionTexture(v3, Vector2.UnitX), //v3
                new VertexPositionTexture(v4, Vector2.One),   //v4
                new VertexPositionTexture(v5, Vector2.UnitY), //v5
            };

            this.buffer = new VertexBuffer(this.device,
                                           typeof(VertexPositionTexture),
                                           this.verts.Length,
                                           BufferUsage.None);
            this.buffer.SetData <VertexPositionTexture>(this.verts);

            this.basicEffect = new BasicEffect(this.device);

            this.effect = this.game.Content.Load <Effect>(@"Effect\Effect1");

            this.texture  = this.game.Content.Load <Texture2D>(textureName);
            this.texture2 = this.game.Content.Load <Texture2D>(texture2Name);
            multi         = 0;
            pode          = false;
        }
Пример #3
0
        public _Quad(GraphicsDevice device, Game game, Color color, Vector3 position, Vector2 size, _WallOrientation orientation)
        {
            this.game   = game;
            this.device = device;
            this.world  = Matrix.Identity;

            switch (orientation)
            {
            case _WallOrientation.South:
                isSouth(position, size);
                break;

            case _WallOrientation.North:
                isNorth(position, size);
                break;

            case _WallOrientation.East:
                isEast(position, size);
                break;

            case _WallOrientation.West:
                isWest(position, size);
                break;

            case _WallOrientation.Up:
                isUp(position, size);
                break;

            case _WallOrientation.Down:
                isDown(position, size);
                break;
            }

            this.verts = new VertexPositionColor[]
            {
                new VertexPositionColor(v0, color), //v0
                new VertexPositionColor(v1, color), //v1
                new VertexPositionColor(v2, color), //v2

                new VertexPositionColor(v3, color), //v3
                new VertexPositionColor(v4, color), //v4
                new VertexPositionColor(v5, color), //v5
            };

            this.buffer = new VertexBuffer(this.device,
                                           typeof(VertexPositionColor),
                                           this.verts.Length,
                                           BufferUsage.None);
            this.buffer.SetData <VertexPositionColor>(this.verts);

            this.effect = new BasicEffect(this.device);
        }