Jypeli 10
The simple game programming library
Renderer.cs
Siirry tämän tiedoston dokumentaatioon.
1#region MIT License
2/*
3 * Copyright (c) 2009 University of Jyväskylä, Department of Mathematical
4 * Information Technology.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24#endregion
25
26/*
27 * Authors: Tero Jäntti, Tomi Karppinen, Janne Nikkanen.
28 */
29
30using System;
31using System.Linq;
32using FontStashSharp;
33using Microsoft.Xna.Framework;
34using Microsoft.Xna.Framework.Graphics;
35
36using XnaV2 = Microsoft.Xna.Framework.Vector2;
37using XnaV3 = Microsoft.Xna.Framework.Vector3;
38
39
40namespace Jypeli
41{
49 public static class Renderer
50 {
54 static readonly VertexPositionTexture[] textureVertices = new VertexPositionTexture[]
55 {
56 new VertexPositionTexture( new XnaV3(-0.5f, 0.5f, 0), new XnaV2(0.0f, 0.0f) ),
57 new VertexPositionTexture( new XnaV3(-0.5f, -0.5f, 0), new XnaV2(0.0f, 1.0f) ),
58 new VertexPositionTexture( new XnaV3(0.5f, 0.5f, 0), new XnaV2(1.0f, 0.0f) ),
59 new VertexPositionTexture( new XnaV3(0.5f, -0.5f, 0), new XnaV2(1.0f, 1.0f) )
60 };
61
65 static readonly Int16[] textureTriangleIndices = new short[]
66 {
67 0, 1, 2,
68 1, 3, 2
69 };
70
74 public static bool LightingEnabled { get; set; }
75
76 static readonly BlendState NoDrawingToScreenBufferBlendState = new BlendState
77 {
78 ColorWriteChannels = ColorWriteChannels.None,
79 };
80
81 static readonly DepthStencilState drawShapeToStencilBufferState = new DepthStencilState
82 {
83 StencilEnable = true,
84 ReferenceStencil = 0,
85 StencilFunction = CompareFunction.Equal,
86 StencilPass = StencilOperation.IncrementSaturation,
87 };
88
89 static readonly DepthStencilState drawAccordingToStencilBufferState = new DepthStencilState
90 {
91 StencilEnable = true,
92 ReferenceStencil = 1,
93 StencilFunction = CompareFunction.LessEqual,
94 StencilPass = StencilOperation.Keep,
95 };
96
97 private static bool isDrawingInsideShape = false;
98 private static DepthStencilState currentStencilState = DepthStencilState.None;
99
100 private static VertexPositionTexture[] MakeTextureVertices( Vector wrapSize )
101 {
102 VertexPositionTexture[] tempVertices = new VertexPositionTexture[textureVertices.Length];
103 for ( int i = 0; i < textureVertices.Length; i++ )
104 {
105 tempVertices[i].Position = textureVertices[i].Position;
106 }
107
108 float px = MathHelper.Clamp( (float)wrapSize.X, -1, 1 );
109 float py = MathHelper.Clamp( (float)wrapSize.Y, -1, 1 );
110
111 // Since the origin in texture coordinates is at upper left corner,
112 // but at center in an object's coordinates, we need to make some
113 // adjustments here. Also, this makes partial textures possible.
114 float left = -(float)Math.Sign( wrapSize.X ) / 2 + 0.5f;
115 float right = left + px;
116 float top = -(float)Math.Sign( wrapSize.Y ) / 2 + 0.5f;
117 float bottom = top + py;
118
119 tempVertices[0].TextureCoordinate = new XnaV2( left, top );
120 tempVertices[1].TextureCoordinate = new XnaV2( left, bottom );
121 tempVertices[2].TextureCoordinate = new XnaV2( right, top );
122 tempVertices[3].TextureCoordinate = new XnaV2( right, bottom );
123
124 return tempVertices;
125 }
126
133 public static void DrawImage( Image texture, ref Matrix matrix, Vector wrapSize )
134 {
135 if ( wrapSize.X == 0 || wrapSize.Y == 0 ) return;
136
137 var device = Game.GraphicsDevice;
138 var tempVertices = MakeTextureVertices( wrapSize );
139
140 device.RasterizerState = RasterizerState.CullClockwise;
141#if WINDOWS_PHONE
142 // The WP7 emulator interprets cullmodes incorectly sometimes.
143 device.RasterizerState = RasterizerState.CullNone;
144#endif
145
146 device.BlendState = BlendState.AlphaBlend;
147
148 float wrapX = (float)Math.Abs( wrapSize.X );
149 float wrapY = (float)Math.Abs( wrapSize.Y );
150
151 if ( wrapX <= 1 && wrapY <= 1 )
152 {
153 // Draw only once
154 DrawImageTexture( texture, matrix, device, tempVertices );
155 return;
156 }
157
158 float wx = (float)( Math.Sign( wrapSize.X ) );
159 float wy = (float)( Math.Sign( wrapSize.Y ) );
160 float tileW = 1 / wrapX;
161 float tileH = 1 / wrapY;
162 float topLeftX = -0.5f + 0.5f * tileW;
163 float topLeftY = 0.5f - 0.5f * tileH;
164 float partX = wrapX - (int)wrapX;
165 float partY = wrapY - (int)wrapY;
166
167 for ( int y = 0; y < (int)wrapY; y++ )
168 {
169 for ( int x = 0; x < (int)wrapX; x++ )
170 {
171 Matrix m =
172 Matrix.CreateScale( 1 / wrapX, 1 / wrapY, 1 ) *
173 Matrix.CreateTranslation( topLeftX + x * tileW, topLeftY - y * tileH, 0 ) *
174 matrix;
175 DrawImageTexture( texture, m, device, tempVertices );
176 }
177
178 if ( partX > 0 )
179 {
180 // Draw a partial horizontal tile
181 Matrix m =
182 Matrix.CreateScale( partX, 1, 1 ) *
183 Matrix.CreateScale( 1 / wrapX, 1 / wrapY, 1 ) *
184 Matrix.CreateTranslation( -tileW / 2 + tileW * partX / 2, 0, 0 ) *
185 Matrix.CreateTranslation( topLeftX + (int)wrapX * tileW, topLeftY - y * tileH, 0 ) *
186 matrix;
187
188 DrawImage( texture, ref m, new Vector( wx * partX, wy ) );
189 }
190 }
191
192 if ( partY > 0 )
193 {
194 for ( int x = 0; x < (int)wrapX; x++ )
195 {
196 // Draw a partial vertical tile
197 Matrix m =
198 Matrix.CreateScale( 1, partY, 1 ) *
199 Matrix.CreateScale( 1 / wrapX, 1 / wrapY, 1 ) *
200 Matrix.CreateTranslation( 0, tileH / 2 - tileH * partY / 2, 0 ) *
201 Matrix.CreateTranslation( topLeftX + x * tileW, topLeftY - (int)wrapY * tileH, 0 ) *
202 matrix;
203
204 DrawImage( texture, ref m, new Vector( wx, wy * partY ) );
205 }
206
207 if ( partX > 0 )
208 {
209 // Draw a partial diagonal tile
210 Matrix m =
211 Matrix.CreateScale( partX, partY, 1 ) *
212 Matrix.CreateScale( 1 / wrapX, 1 / wrapY, 1 ) *
213 Matrix.CreateTranslation( -tileW / 2 + tileW * partX / 2, tileH / 2 - tileH * partY / 2, 0 ) *
214 Matrix.CreateTranslation( topLeftX + (int)wrapX * tileW, topLeftY - (int)wrapY * tileH, 0 ) *
215 matrix;
216
217 DrawImage( texture, ref m, new Vector( wx * partX, wy * partY ) );
218 }
219 }
220 }
221
222 private static void DrawImageTexture( Image texture, Matrix matrix, GraphicsDevice device, VertexPositionTexture[] tempVertices )
223 {
224 Effect effect = Graphics.GetTextureEffect( ref matrix, texture.XNATexture, LightingEnabled );
226
227 foreach ( EffectPass pass in effect.CurrentTechnique.Passes )
228 {
229 pass.Apply();
230 Game.GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionTexture>(
231 PrimitiveType.TriangleList,
232 tempVertices, 0, tempVertices.Length,
234 );
235 }
236
238 }
239
249 public static void BeginDrawingInsideShape( Shape shape, ref Matrix transformation )
250 {
251 if ( shape.Cache.Triangles == null )
252 throw new ArgumentException( "The shape must have triangles" );
254 throw new Exception( "EndDrawingInsideShape must be called before calling this function again" );
255
257 var device = Game.GraphicsDevice;
258
259 device.Clear( ClearOptions.Stencil, Color.Black.AsXnaColor(), 0, 0 );
260 device.DepthStencilState = currentStencilState = drawShapeToStencilBufferState;
261
263
264 device.DepthStencilState = currentStencilState = drawAccordingToStencilBufferState;
265 }
266
270 public static void EndDrawingInsideShape()
271 {
273 throw new Exception( "BeginDrawingInsideShape must be called first" );
274
275 Game.GraphicsDevice.DepthStencilState = currentStencilState = DepthStencilState.None;
276 isDrawingInsideShape = false;
277 }
278
286 public static void DrawText( string text, Vector position, Font font, Color color )
287 {
288 Vector2 textSize = font.XnaFont.MeasureString(text);
289 Vector2 xnaPos = ScreenView.ToXnaCoords( position, Game.Screen.Size, (Vector)textSize );
290
291 SpriteBatch spriteBatch = Graphics.SpriteBatch;
292 spriteBatch.Begin();
293 font.XnaFont.DrawText(Graphics.FontRenderer, text, xnaPos.ToSystemNumerics(), color.AsXnaColor().ToSystemDrawing());
294 spriteBatch.End();
295 }
296
304 public static void DrawText( string text, ref Matrix transformation, Font font, Color color )
305 {
306 Vector textSize = (Vector)font.XnaFont.MeasureString( text );
307 Matrix m = ScreenView.ToXnaCoords(ref transformation, Game.Screen.Size, textSize );
308
309 SpriteBatch spriteBatch = Graphics.SpriteBatch;
310 spriteBatch.Begin( SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.LinearClamp, currentStencilState, RasterizerState.CullCounterClockwise, null, m );
311 font.XnaFont.DrawText(Graphics.FontRenderer, text, Vector2.Zero.ToSystemNumerics(), color.AsXnaColor().ToSystemDrawing());
312 spriteBatch.End();
313 }
314
322 public static void DrawText(string text, ref Matrix transformation, Font font, Color[] colors)
323 {
324 Vector textSize = (Vector)font.XnaFont.MeasureString(text);
325 Matrix m = ScreenView.ToXnaCoords(ref transformation, Game.Screen.Size, textSize);
326
327 SpriteBatch spriteBatch = Graphics.SpriteBatch;
328 spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.LinearClamp, currentStencilState, RasterizerState.CullCounterClockwise, null, m);
329 font.XnaFont.DrawText(Graphics.FontRenderer, text, Vector2.Zero.ToSystemNumerics(), colors.ConvertAll(v => v.AsXnaColor().ToSystemDrawing()).ToArray());
330 spriteBatch.End();
331 }
332
336 public static void DrawShape( Shape shape, ref Matrix transformation, ref Matrix textureTransformation, Image texture, Vector textureWrapSize, Color color )
337 {
338 BeginDrawingInsideShape( shape, ref transformation );
339 DrawImage( texture, ref textureTransformation, textureWrapSize );
341 }
342
349 public static void DrawShape( Shape shape, ref Matrix matrix, Color color )
350 {
351 if ( shape is RaySegment )
352 {
353 DrawRaySegment( (RaySegment)shape, ref matrix, color );
354 }
355 else if ( shape.Cache.Triangles != null )
356 {
357 DrawFilledShape( shape.Cache, ref matrix, color );
358 }
359 else
360 {
361 DrawPolygon( shape.Cache.OutlineVertices, ref matrix, color );
362 }
363 }
364
371 public static void DrawRaySegment( RaySegment segment, ref Matrix matrix, Color color )
372 {
373 var device = Game.GraphicsDevice;
374
375 Vector endPoint = segment.Origin + segment.Direction * segment.Length;
376
377 VertexPositionColor[] colorVertices = new VertexPositionColor[2];
378 colorVertices[0].Position = new Vector3( (float)segment.Origin.X, (float)segment.Origin.Y, 0 );
379 colorVertices[0].Color = color.AsXnaColor();
380 colorVertices[1].Position = new Vector3( (float)endPoint.X, (float)endPoint.Y, 0 );
381 colorVertices[1].Color = color.AsXnaColor();
382
383 BasicEffect effect = Graphics.BasicColorEffect;
384 effect.World = matrix;
386 foreach ( EffectPass pass in effect.CurrentTechnique.Passes )
387 {
388 pass.Apply();
389 device.DrawUserPrimitives<VertexPositionColor>( PrimitiveType.LineStrip, colorVertices, 0, 1 );
390 }
392 }
393
397 internal static void DrawRectangle( ref Matrix matrix, Color color )
398 {
399 Vector[] vertices = new Vector[]
400 {
401 new Vector(-0.5, 0.5),
402 new Vector(-0.5, -0.5),
403 new Vector(0.5, -0.5),
404 new Vector(0.5, 0.5),
405 };
406 Renderer.DrawPolygon( vertices, ref matrix, color );
407 }
408
409 internal static void DrawFilledShape( ShapeCache cache, ref Matrix matrix, Color color )
410 {
411 DrawFilledShape( cache, ref matrix, color, BlendState.NonPremultiplied );
412 }
413
414 internal static void DrawFilledShape( ShapeCache cache, ref Matrix matrix, Color color, BlendState blendState )
415 {
416 var device = Game.GraphicsDevice;
417
418 VertexPositionColor[] vertices = new VertexPositionColor[cache.Vertices.Length];
419 for ( int i = 0; i < vertices.Length; i++ )
420 {
421 Vector v = cache.Vertices[i];
422 vertices[i] = new VertexPositionColor( new XnaV3( (float)v.X, (float)v.Y, 0 ), color.AsXnaColor() );
423 }
424
425 Int16[] indices = new Int16[cache.Triangles.Length * 3];
426 for ( int i = 0; i < cache.Triangles.Length; i++ )
427 {
428 indices[3 * i] = cache.Triangles[i].i1;
429 indices[3 * i + 1] = cache.Triangles[i].i2;
430 indices[3 * i + 2] = cache.Triangles[i].i3;
431 }
432
433 device.RasterizerState = RasterizerState.CullCounterClockwise;
434 device.BlendState = blendState;
435#if WINDOWS_PHONE
436 // The WP7 emulator interprets cullmodes incorectly sometimes.
437 device.RasterizerState = RasterizerState.CullNone;
438#endif
439
440 Effect effect = Graphics.GetColorEffect( ref matrix, LightingEnabled );
442 foreach ( EffectPass pass in effect.CurrentTechnique.Passes )
443 {
444 pass.Apply();
445 device.DrawUserIndexedPrimitives<VertexPositionColor>(
446 PrimitiveType.TriangleList,
447 vertices, 0, vertices.Length,
448 indices, 0, indices.Length / 3
449 );
450 }
452 }
453
460 public static void DrawPolygon( Vector[] vertices, ref Matrix matrix, Color color )
461 {
462 if ( vertices.Length < 3 )
463 throw new ArgumentException( "Polygon must have at least three vertices" );
464
465 var device = Game.GraphicsDevice;
466
467 VertexPositionColor[] colorVertices = new VertexPositionColor[vertices.Length];
468 for ( int i = 0; i < colorVertices.Length; i++ )
469 {
470 Vector p = vertices[i];
471 colorVertices[i] = new VertexPositionColor(
472 new XnaV3( (float)p.X, (float)p.Y, 0 ),
473 color.AsXnaColor()
474 );
475 }
476
477 int n = colorVertices.Length;
478 Int16[] indices = new Int16[2 * n];
479 for ( int i = 0; i < ( n - 1 ); i++ )
480 {
481 indices[2 * i] = (Int16)i;
482 indices[2 * i + 1] = (Int16)( i + 1 );
483 }
484 indices[2 * ( n - 1 )] = (Int16)( n - 1 );
485 indices[2 * ( n - 1 ) + 1] = (Int16)0;
486
487 Effect effect = Graphics.GetColorEffect( ref matrix, LightingEnabled );
489 foreach ( EffectPass pass in effect.CurrentTechnique.Passes )
490 {
491 pass.Apply();
492 device.DrawUserIndexedPrimitives<VertexPositionColor>(
493 PrimitiveType.LineStrip,
494 colorVertices, 0, colorVertices.Length,
495 indices, 0, indices.Length - 1
496 );
497
498 }
500 }
501
502
503 internal static void DrawVertices( Vector[] vertices, Matrix matrix, Color color )
504 {
505 VertexPositionColor[] pointVertices = new VertexPositionColor[vertices.Length];
506 for ( int i = 0; i < pointVertices.Length; i++ )
507 {
508 Vector p = vertices[i];
509 pointVertices[i] = new VertexPositionColor(
510 new XnaV3( (float)p.X, (float)p.Y, 0 ),
512 );
513 }
514
515 var device = Game.GraphicsDevice;
516 //device.RenderState.PointSize = 2;
517
518 BasicEffect effect = Graphics.BasicColorEffect;
519 effect.World = matrix;
521 foreach ( var pass in effect.CurrentTechnique.Passes )
522 {
523 pass.Apply();
524 device.DrawUserPrimitives<VertexPositionColor>(
525 PrimitiveType.LineList,
526 pointVertices, 0, pointVertices.Length
527 );
528 }
530 }
531 }
532}
533
Microsoft.Xna.Framework.Vector2 XnaV2
Definition: Font.cs:4
System.Numerics.Vector2 Vector2
Microsoft.Xna.Framework.Vector3 XnaV3
Definition: Renderer.cs:37
Fontti.
Definition: Font.cs:24
DynamicSpriteFont XnaFont
Definition: Font.cs:50
static new GraphicsDevice GraphicsDevice
XNA:n grafiikkakortti.
Definition: Graphics.cs:49
static ScreenView Screen
Näytön dimensiot, eli koko ja reunat.
Definition: Graphics.cs:90
Contains graphics resources.
Definition: Graphics.cs:36
static void SetSamplerState()
Definition: Graphics.cs:130
static Effect GetColorEffect(ref Matrix worldMatrix, bool lightingEnabled)
Definition: Graphics.cs:167
static SpriteBatch SpriteBatch
Definition: Graphics.cs:40
static void ResetSamplerState()
Definition: Graphics.cs:136
static Effect GetTextureEffect(ref Matrix worldMatrix, Texture2D texture, bool lightingEnabled)
Definition: Graphics.cs:146
static BasicEffect BasicColorEffect
Definition: Graphics.cs:38
static FontStashSharp.Renderer FontRenderer
Definition: Graphics.cs:42
Kuva.
Definition: Image.cs:30
Texture2D XNATexture
Definition: Image.cs:72
Vector Origin
Lähtöpiste
Definition: Shapes.cs:505
double Length
Pituus
Definition: Shapes.cs:515
Vector Direction
Suunta
Definition: Shapes.cs:510
Luokka, joka sisältää metodeita kuvioiden ja tekstuurien piirtämiseen 2D-tasossa.
Definition: Renderer.cs:50
static void DrawPolygon(Vector[] vertices, ref Matrix matrix, Color color)
Piirtää monikulmion ruudulle
Definition: Renderer.cs:460
static DepthStencilState currentStencilState
Definition: Renderer.cs:98
static void DrawShape(Shape shape, ref Matrix transformation, ref Matrix textureTransformation, Image texture, Vector textureWrapSize, Color color)
Piirtää kuvion niin, että tekstuuri täyttää sen.
Definition: Renderer.cs:336
static readonly DepthStencilState drawShapeToStencilBufferState
Definition: Renderer.cs:81
static VertexPositionTexture[] MakeTextureVertices(Vector wrapSize)
Definition: Renderer.cs:100
static void DrawFilledShape(ShapeCache cache, ref Matrix matrix, Color color, BlendState blendState)
Definition: Renderer.cs:414
static void DrawImageTexture(Image texture, Matrix matrix, GraphicsDevice device, VertexPositionTexture[] tempVertices)
Definition: Renderer.cs:222
static void DrawRectangle(ref Matrix matrix, Color color)
Piirtää suorakulmion.
Definition: Renderer.cs:397
static void EndDrawingInsideShape()
Lopettaa muodon sisälle piirtämisen
Definition: Renderer.cs:270
static void DrawShape(Shape shape, ref Matrix matrix, Color color)
Piirtää muodon ruudulle
Definition: Renderer.cs:349
static void DrawImage(Image texture, ref Matrix matrix, Vector wrapSize)
Piirtää kuvan
Definition: Renderer.cs:133
static void DrawText(string text, ref Matrix transformation, Font font, Color color)
Piirtää tekstiä ruudulle
Definition: Renderer.cs:304
static void DrawRaySegment(RaySegment segment, ref Matrix matrix, Color color)
Piirtää säteen ruudulle
Definition: Renderer.cs:371
static readonly DepthStencilState drawAccordingToStencilBufferState
Definition: Renderer.cs:89
static readonly BlendState NoDrawingToScreenBufferBlendState
Definition: Renderer.cs:76
static void DrawVertices(Vector[] vertices, Matrix matrix, Color color)
Definition: Renderer.cs:503
static void BeginDrawingInsideShape(Shape shape, ref Matrix transformation)
Makes all the subsequent draw calls until EndDrawingInsideShape limit the drawing inside shape (trans...
Definition: Renderer.cs:249
static bool isDrawingInsideShape
Definition: Renderer.cs:97
static void DrawText(string text, Vector position, Font font, Color color)
Piirtää tekstiä ruudulle
Definition: Renderer.cs:286
static void DrawFilledShape(ShapeCache cache, ref Matrix matrix, Color color)
Definition: Renderer.cs:409
static readonly Int16[] textureTriangleIndices
Indices that form two triangles from the vertex array.
Definition: Renderer.cs:65
static void DrawText(string text, ref Matrix transformation, Font font, Color[] colors)
Piirtää tekstiä ruudulle
Definition: Renderer.cs:322
static readonly VertexPositionTexture[] textureVertices
Vertices that form a rectangle on which to draw textures.
Definition: Renderer.cs:54
static bool LightingEnabled
Onko valaistus käytössä
Definition: Renderer.cs:74
Sisältää näytön leveyden ja korkeuden sekä reunojen koordinaatit. Y-koordinaatti kasvaa ylöspäin....
Definition: View.cs:45
static Vector2 ToXnaCoords(Vector position, Vector screenSize, Vector objectSize)
Muuntaa Jypelin ruutukoordinaateista XNA:n ruutukoordinaateiksi.
Definition: View.cs:390
Vector Size
Näytön koko vektorina.
Definition: View.cs:248
Sisältää valmiiksi lasketut kolmiot, joiden avulla piirtäminen on suoraviivaista.
Definition: Shapes.cs:628
readonly Vector[] OutlineVertices
Ulkoreunan verteksit, lueteltuna vastapäivään.
Definition: Shapes.cs:636
readonly IndexTriangle[] Triangles
Kolmiot, joiden avulla kuvio voidaan täyttää värillä.
Definition: Shapes.cs:646
readonly Vector[] Vertices
Kaikki verteksit, ml. kolmioiden kulmapisteet.
Definition: Shapes.cs:641
Kuvio.
Definition: Shapes.cs:47
abstract ShapeCache Cache
Muodon verteksit sisällään pitävä olio.
Definition: Shapes.cs:58
Microsoft.Xna.Framework.Vector2 XnaV2
Definition: Mouse.cs:37
Microsoft.Xna.Framework.Matrix Matrix
Definition: Mouse.cs:36
Väri.
Definition: Color.cs:13
static readonly Color White
Valkoinen.
Definition: Color.cs:956
static readonly Color Black
Musta.
Definition: Color.cs:556
static readonly Color Red
Punainen.
Definition: Color.cs:866
XnaColor AsXnaColor()
Definition: Color.cs:46
Int16 i1
Kulmapisteet.
Definition: Shapes.cs:602
2D-vektori.
Definition: Vector.cs:67
double Y
Vektorin Y-komponentti
Definition: Vector.cs:339
double X
Vektorin X-komponentti.
Definition: Vector.cs:334