Jypeli
5
The simple game programming library
AnimationReader.cs
Siirry tämän tiedoston dokumentaatioon.
1
using
System
;
2
using
System
.Collections.Generic;
3
using
System
.Linq;
4
using
System
.Text;
5
using
Microsoft.Xna.Framework.Content;
6
using
Jypeli
;
7
using
Microsoft.Xna.Framework.
Graphics
;
8
9
namespace
Jypeli
.Content
10
{
11
public
class
AnimationReader
: ContentTypeReader<Animation>
12
{
13
protected
override
Animation
Read
( ContentReader input,
Animation
existingInstance )
14
{
15
int
fps = input.ReadObject<
int
>();
16
int
frameCount = input.ReadObject<
int
>();
17
var frames =
new
Image
[frameCount];
18
19
for
(
int
i = 0; i < frameCount; )
20
{
21
Texture2D xnaFrame = input.ReadExternalReference<Texture2D>();
22
if
( xnaFrame == null )
continue
;
23
frames[i] =
new
Image
( xnaFrame );
24
i++;
25
}
26
27
return
new
Animation
( frames ) { FPS = fps };
28
}
29
}
30
}
System
Jypeli.Content.AnimationReader.Read
override Animation Read(ContentReader input, Animation existingInstance)
Definition:
AnimationReader.cs:13
Jypeli
Jypeli.Image
Kuva.
Definition:
Image.cs:24
Jypeli.Graphics
Contains graphics resources.
Definition:
Graphics.cs:36
Jypeli.Animation
Sarja kuvia, jotka vaihtuvat halutulla nopeudella. Yksi animaatio koostuu yhdestä tai useammasta kuva...
Definition:
Animation.cs:56
Jypeli.Content.AnimationReader
Definition:
AnimationReader.cs:11
Jypeli
Storage
AnimationReader.cs
Generoinut projektille Jypeli Fri Sep 15 2017 21:57:28
1.8.13