3using System.Collections.Generic;
4using Microsoft.Xna.Framework;
5using Microsoft.Xna.Framework.Graphics;
35 static readonly Vector3[]
Vertices =
new Vector3[]
38 new Vector3(-0.5f, 0.5f, 0),
39 new Vector3(-0.5f, -0.5f, 0),
40 new Vector3(0.5f, 0.5f, 0),
43 new Vector3(-0.5f, -0.5f, 0),
44 new Vector3(0.5f, -0.5f, 0),
45 new Vector3(0.5f, 0.5f, 0),
99 device.RasterizerState = RasterizerState.CullClockwise;
100 device.BlendState = BlendState.AlphaBlend;
105 for (
int i = 0; i <
effect.CurrentTechnique.Passes.Count; i++ )
106 effect.CurrentTechnique.Passes[i].Apply();
108 device.DrawUserPrimitives<VertexPositionTexture>(
109 PrimitiveType.TriangleList,
127 Matrix.CreateScale( size.X, size.Y, 1f )
128 *
Matrix.CreateRotationZ( angle )
129 *
Matrix.CreateTranslation( position.X, position.Y, 0 )
System.Numerics.Vector2 Vector2
static new GraphicsDevice GraphicsDevice
XNA:n grafiikkakortti.
Contains graphics resources.
static void SetSamplerState()
static void ResetSamplerState()
static Effect GetTextureEffect(ref Matrix worldMatrix, Texture2D texture, bool lightingEnabled)
Draws images efficiently. Draw() calls should be made only between Begin() and End() calls....
void Begin(ref Matrix matrix, Texture2D texture)
void Draw(TextureCoordinates c, Vector2 position, Vector2 size, float angle)
VertexPositionTexture[] vertexBuffer
static readonly int VerticesPerTexture
static readonly Vector3[] Vertices
const int DefaultBufferSize
Microsoft.Xna.Framework.Matrix Matrix