本文整理汇总了C#中MiswGame2007.GraphicsDevice.DrawImageAlpha方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsDevice.DrawImageAlpha方法的具体用法?C# GraphicsDevice.DrawImageAlpha怎么用?C# GraphicsDevice.DrawImageAlpha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MiswGame2007.GraphicsDevice
的用法示例。
在下文中一共展示了GraphicsDevice.DrawImageAlpha方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(GraphicsDevice graphics)
{
if (!background)
{
int drawX = (int)Math.Round(position.X) - game.IntCameraX;
int drawY = (int)Math.Round(position.Y) - game.IntCameraY - 32;
graphics.DrawImageAlpha(GameImage.Rain, 1, 64, 0, 0, drawX, drawY, 64);
}
else
{
int drawX = (int)Math.Round(position.X) + game.IntBackgroundX;
int drawY = (int)Math.Round(position.Y) + game.IntBackgroundY - 32;
graphics.DrawImageAlpha(GameImage.Rain, 1, 64, 0, 1, drawX, drawY, 32);
}
}
示例2: Draw
public override void Draw(GraphicsDevice graphics)
{
int drawX = (int)Math.Round(position.X) - game.IntCameraX - 8;
int drawY = (int)Math.Round(position.Y) - game.IntCameraY - 8;
if (animation < 48)
{
graphics.DrawImage(GameImage.Debris, 16, 16, type, animation / 2 % 8, drawX, drawY, 64, 64, 64);
}
else
{
graphics.DrawImageAlpha(GameImage.Debris, 16, 16, type, animation / 2 % 8, drawX, drawY, 255 - 16 * (animation - 48), 64, 64, 64);
}
}
示例3: Draw
public void Draw(GraphicsDevice graphics)
{
int drawX = (int)Math.Round(position.X) - game.IntCameraX;
int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
if (visible)
{
if (fadeCount < 64)
{
graphics.DrawImageAlpha(GameImage.Block, 64, 64, 3, 0, drawX, drawY, 4 * fadeCount);
graphics.DrawImageAlpha(GameImage.Block, 64, 64, 3, 1, drawX, drawY, 4 * fadeCount);
}
else if (slideCount < 20)
{
graphics.DrawImage(GameImage.Block, 64, 64, 3, 0, drawX, drawY);
graphics.DrawImage2(GameImage.Block, 76 + slideCount, 196, 20 - slideCount, 60, drawX + 12, drawY + 4);
graphics.DrawImage2(GameImage.Block, 96, 196, 20 - slideCount, 60, drawX + 32 + slideCount, drawY + 4);
}
else
{
graphics.DrawImage(GameImage.Block, 64, 64, 3, 0, drawX, drawY);
}
}
}
示例4: DrawNumber
private void DrawNumber(GraphicsDevice graphics, int n, int x, int y, int alpha, int white)
{
graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 4 + n / 8, n % 8, x, y, alpha);
if (white > 0)
{
graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 6 + n / 8, n % 8, x, y, white * alpha / 255);
}
}
示例5: DrawPlayerInfo
public void DrawPlayerInfo(GraphicsDevice graphics, int alpha)
{
graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 0, 8, Settings.SCREEN_HEIGHT - 40, alpha);
for (int i = 0; i < 6; i++)
{
graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 1, 8 + 32 + 32 * i, Settings.SCREEN_HEIGHT - 40, alpha);
}
graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 2, 8 + 32 + 192, Settings.SCREEN_HEIGHT - 40, alpha);
if (player.DrawHealth > 0)
{
int damageCount = player.DamageCount;
graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10, 2 * player.DrawHealth, 1, 255, 128 + damageCount / 2, 128 + damageCount / 2, alpha);
graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10 + 1, 2 * player.DrawHealth, 12 - 2, 255, damageCount, damageCount, alpha);
graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10 + 11, 2 * player.DrawHealth, 1, 128 + damageCount / 2, damageCount, damageCount, alpha);
}
if (player.CurrentWeapon != Player.Weapon.Pistol)
{
graphics.DrawImageAlpha(GameImage.Hud, 96, 32, 3, 0, 8, Settings.SCREEN_HEIGHT - 80, alpha);
switch (player.CurrentWeapon)
{
case Player.Weapon.Machinegun:
graphics.DrawImageAlpha(GameImage.Item, 32, 32, 0, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha);
break;
case Player.Weapon.Rocket:
graphics.DrawImageAlpha(GameImage.Item, 32, 32, 2, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha);
break;
case Player.Weapon.Shotgun:
graphics.DrawImageAlpha(GameImage.Item, 32, 32, 1, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha);
break;
case Player.Weapon.Flamethrower:
graphics.DrawImageAlpha(GameImage.Item, 32, 32, 3, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha);
break;
}
}
int ammo = player.Ammo;
if (ammo / 100 > 0)
{
DrawNumber(graphics, ammo / 100 % 10, 40, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount);
}
if (ammo / 10 > 0)
{
DrawNumber(graphics, ammo / 10 % 10, 40 + 19, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount);
}
if (ammo > 0)
{
DrawNumber(graphics, ammo % 10, 40 + 19 + 19, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount);
}
if (player.AmmoHudColorCount > 0)
{
graphics.DrawImageAlpha(GameImage.Hud, 96, 32, 3, 1, 8, Settings.SCREEN_HEIGHT - 80, player.AmmoHudColorCount * alpha / 255);
}
}
示例6: Draw
public override void Draw(GraphicsDevice graphics)
{
int drawX = (int)Math.Round(position.X) - game.IntCameraX - 16;
int drawY = (int)Math.Round(position.Y) - game.IntCameraY - 16;
graphics.DrawImageAlpha(GameImage.PlayerBullet, 32, 32, animation / 2 / 8 + 2, animation / 2 % 8, drawX, drawY, 255 - animation * 8);
}
示例7: DrawPenguin
private void DrawPenguin(int beginTick, int endTick, int dy, GraphicsDevice graphics)
{
if (numTicks < beginTick)
{
return;
}
if (endTick < numTicks)
{
return;
}
int alpha = 255;
if (numTicks < (beginTick + endTick) / 2)
{
if (numTicks - beginTick < 64)
{
alpha = 4 * (numTicks - beginTick);
}
}
else if ((beginTick + endTick) / 2 < numTicks)
{
if (endTick - numTicks < 64)
{
alpha = 4 * (endTick - numTicks);
}
}
graphics.DrawImageAlpha(GameImage.Penguin, 256, 256, 0, 0, (Settings.SCREEN_WIDTH - 256) / 2, (Settings.SCREEN_HEIGHT - 256) / 2 + dy, alpha);
}
示例8: Draw
public void Draw(GraphicsDevice graphics, int r, int g, int b)
{
int topRow = game.IntCameraY / Settings.BLOCK_WDITH;
int bottomRow = (game.IntCameraY + Settings.SCREEN_HEIGHT) / Settings.BLOCK_WDITH;
int leftCol = game.IntCameraX / Settings.BLOCK_WDITH;
int rightCol = (game.IntCameraX + Settings.SCREEN_WIDTH) / Settings.BLOCK_WDITH;
for (int row = topRow; row <= bottomRow; row++)
{
for (int col = leftCol; col <= rightCol; col++)
{
int block = this[row, col];
if (block > 0)
{
int drawX = col * Settings.BLOCK_WDITH - game.IntCameraX;
int drawY = row * Settings.BLOCK_WDITH - game.IntCameraY;
int textureRow = block / 8;
int textureCol = block % 8;
if (block != 16)
{
graphics.DrawImage(GameImage.Block, Settings.BLOCK_WDITH, Settings.BLOCK_WDITH, textureRow, textureCol, drawX, drawY, r, g, b);
}
else
{
graphics.DrawImageAlpha(GameImage.Block, Settings.BLOCK_WDITH, Settings.BLOCK_WDITH, textureRow, textureCol, drawX, drawY, 128, r, g, b);
}
}
}
}
}