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