本文整理汇总了C#中ObjectEntry类的典型用法代码示例。如果您正苦于以下问题:C# ObjectEntry类的具体用法?C# ObjectEntry怎么用?C# ObjectEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectEntry类属于命名空间,在下文中一共展示了ObjectEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBounds
public override Rectangle GetBounds(ObjectEntry obj, Point camera)
{
if (obj.SubType < labels.Length)
return new Rectangle(obj.X + imgs[obj.SubType].X - camera.X, obj.Y + imgs[obj.SubType].Y - camera.Y, imgs[obj.SubType].Width, imgs[obj.SubType].Height);
else
return new Rectangle(obj.X + img.X - camera.X, obj.Y + img.Y - camera.Y, img.Width, img.Height);
}
示例2: Bounds
public override Rectangle Bounds(ObjectEntry obj, Point camera)
{
if (obj.SubType <= 10)
return new Rectangle(obj.X + offsets[obj.SubType].X - camera.X, obj.Y + offsets[obj.SubType].Y - camera.Y, imgs[obj.SubType].Width, imgs[obj.SubType].Height);
else
return new Rectangle(obj.X + offset.X - camera.X, obj.Y + offset.Y - camera.Y, img.Width, img.Height);
}
示例3: GetSprite
public override Sprite GetSprite(ObjectEntry obj)
{
byte subtype = obj.SubType;
if (obj.SubType > labels.Length) subtype = 0;
BitmapBits bits = new BitmapBits(imgs[subtype].Image);
bits.Flip(obj.XFlip, obj.YFlip);
return new Sprite(bits, new Point(obj.X + imgs[subtype].Offset.X, obj.Y + imgs[subtype].Offset.Y));
}
示例4: GetSprite
public override Sprite GetSprite(ObjectEntry obj)
{
int st = -(((obj.SubType & 0x1F) * img.Width) / 2) + img.X;
List<Sprite> sprs = new List<Sprite>();
for (int i = 0; i < (obj.SubType & 0x1F); i++)
sprs.Add(new Sprite(img.Image, new Point(st + (i * img.Width), img.Y)));
Sprite spr = new Sprite(sprs.ToArray());
spr.Offset = new Point(spr.X + obj.X, spr.Y + obj.Y);
return spr;
}
示例5: GetSprite
public override Sprite GetSprite(ObjectEntry obj)
{
int w = ((obj.SubType >> 4) + 1) * 16;
int h = ((obj.SubType & 0xF) + 1) * 16;
BitmapBits bmp = new BitmapBits(w, h);
bmp.DrawRectangle(0x1C, 0, 0, w - 1, h - 1);
Sprite spr = new Sprite(new Sprite(bmp, new Point(-(w / 2), -(h / 2))), img);
spr.Offset = new Point(spr.X + obj.X, spr.Y + obj.Y);
return spr;
}
示例6: GetSprite
public override Sprite GetSprite(ObjectEntry obj)
{
int count = Math.Min(6, obj.SubType & 7) + 1;
Size space = Spacing[obj.SubType >> 4];
Point loc = new Point(img.X, img.Y);
List<Sprite> sprs = new List<Sprite>();
for (int i = 0; i < count; i++)
{
sprs.Add(new Sprite(img.Image, loc));
loc += space;
}
Sprite spr = new Sprite(sprs.ToArray());
spr.Offset = new Point(spr.X + obj.X, spr.Y + obj.Y);
return spr;
}
示例7: GetSprite
public override Sprite GetSprite(ObjectEntry obj)
{
int length = obj.SubType & 15;
List<Sprite> sprs = new List<Sprite>();
sprs.Add(imgs[2]);
int yoff = 16;
for (int i = 0; i < length; i++)
{
sprs.Add(new Sprite(imgs[1].Image, new Point(imgs[1].X, yoff + imgs[1].Y)));
yoff += 16;
}
yoff -= 8;
sprs.Add(new Sprite(imgs[0].Image, new Point(imgs[0].X, yoff + imgs[0].Y)));
Sprite spr = new Sprite(sprs.ToArray());
spr.Offset = new Point(spr.X + obj.X, spr.Y + obj.Y);
return spr;
}
示例8: GetSprite
public override Sprite GetSprite(ObjectEntry obj)
{
int frame = obj.SubType >> 4;
if (frame > 5) frame = 0;
BitmapBits bits = new BitmapBits(imgs[frame].Image);
bits.Flip(obj.XFlip, obj.YFlip);
return new Sprite(bits, new Point(obj.X + imgs[frame].X, obj.Y + imgs[frame].Y));
}
示例9: GetBounds
public override Rectangle GetBounds(ObjectEntry obj, Point camera)
{
int frame = obj.SubType >> 4;
if (frame > 5) frame = 0;
return new Rectangle(obj.X + imgs[frame].X - camera.X, obj.Y + imgs[frame].Y - camera.Y, imgs[frame].Width, imgs[frame].Height);
}
示例10: SetSize
private static void SetSize(ObjectEntry obj, object value)
{
obj.SubType = (byte)((obj.SubType & ~3) | ((byte)value & 3));
}
示例11: SetRDPriority
private static void SetRDPriority(ObjectEntry obj, object value)
{
obj.SubType = (byte)((obj.SubType & ~32) | ((Priority)value == Priority.High ? 32 : 0));
}
示例12: Bounds
public override Rectangle Bounds(ObjectEntry obj, Point camera)
{
return new Rectangle(obj.X + offset.X - camera.X, obj.Y + offset.Y - camera.Y, img.Width, img.Height);
}
示例13: GetDirection
private static object GetDirection(ObjectEntry obj)
{
return (obj.SubType & 4) != 0 ? Direction.Horizontal : Direction.Vertical;
}
示例14: SetDirection
private static void SetDirection(ObjectEntry obj, object value)
{
obj.SubType = (byte)((obj.SubType & ~4) | ((Direction)value == Direction.Horizontal ? 4 : 0));
}
示例15: SetGroundOnly
private static void SetGroundOnly(ObjectEntry obj, object value)
{
obj.SubType = (byte)((obj.SubType & ~128) | ((bool)value == true ? 128 : 0));
}