Пример #1
0
 /// <summary>
 /// Create a Spritelet, which is a moveable sprite 
 /// </summary>
 /// <param name="graphicsFile">The content graphics file with or without extension. If
 /// extension given eg "ball.png", the uncompiled file will be loaded at runtime. If no extension
 /// given eg "ball", precompiled XNA content will be loaded (.xnb files).</param>
 /// <returns></returns>
 public static Entity CreateSpritelet(string graphicsFile)
 {
     Entity e = CreateDrawlet();
     var spriteComp = new SpriteComp(graphicsFile);
     e.AddComponent(spriteComp);
     e.Refresh();
     return e;
 }
Пример #2
0
 /// <summary>
 /// Create a Spritelet with texture based on the contents of a Screen
 /// </summary>
 /// <returns></returns>
 public static Entity CreateSpritelet(ScreenComp screen)
 {
     Entity e = CreateDrawlet();
     var spriteComp = new SpriteComp(screen);
     e.AddComponent(spriteComp);
     e.Refresh();
     return e;
 }
Пример #3
0
 public static Entity CreateSpriteField(string fieldBitmapFile, string spriteBitmapFile)
 {
     Entity e = CreateDrawlet();
     var spriteFieldComp = new SpriteFieldComp(fieldBitmapFile);
     var spriteComp = new SpriteComp(spriteBitmapFile);
     spriteFieldComp.FieldSpacing = new Vector2(spriteComp.Width, spriteComp.Height);
     e.AddComponent(spriteComp);
     e.AddComponent(spriteFieldComp);
     e.Refresh();
     return e;
 }