本文整理汇总了C#中IGraphics.DrawBackground方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphics.DrawBackground方法的具体用法?C# IGraphics.DrawBackground怎么用?C# IGraphics.DrawBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraphics
的用法示例。
在下文中一共展示了IGraphics.DrawBackground方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawBackground
public override void DrawBackground(IGraphics graphics)
{
graphics.SetColor(255, 160, 160, 160);
if (scroll / 512 % 2 == 0)
{
graphics.DrawBackground(Image.Background1, 0, scroll % 512 - 512, 512, 512, 0, 0, BackgroundStretch);
graphics.DrawBackground(Image.Background1, 0, scroll % 512, 512, 512, 1, 0, BackgroundStretch);
}
else
{
graphics.DrawBackground(Image.Background1, 0, scroll % 512 - 512, 512, 512, 1, 0, BackgroundStretch);
graphics.DrawBackground(Image.Background1, 0, scroll % 512, 512, 512, 0, 0, BackgroundStretch);
}
}
示例2: DrawBackground
public override void DrawBackground(IGraphics graphics)
{
graphics.SetColor(255, 255, 255, 255);
for (int i = -1; i < 16; i++)
{
graphics.DrawBackground(Image.Background3, 0, scroll % 32 + i * 32, 512, 32, 0, 0, BackgroundStretch);
}
}
示例3: DrawBackground
public override void DrawBackground(IGraphics graphics)
{
graphics.SetColor(255, 0, 0, 0);
graphics.DrawRectangle(0, 0, Game.FieldWidth, Game.FieldHeight);
graphics.EnableAddBlend();
graphics.SetColor(255, 255, 255, 255);
/*
for (int i = 0; i < NUM_STARS / 4; i++)
{
graphics.DrawBackground(Image.Star, starX[i] - 4, starY[i] - 4, 8, 8, 0, 0, BackgroundStretch);
}
*/
for (int i = NUM_STARS / 4; i < NUM_STARS / 2; i++)
{
graphics.DrawBackground(Image.Star, starX[i] - 4, starY[i] - 4, 8, 8, 0, 1, BackgroundStretch);
}
graphics.SetColor(255, 128, 128, 128);
for (int i = NUM_STARS / 2; i < NUM_STARS; i++)
{
graphics.DrawBackground(Image.Star, starX[i] - 4, starY[i] - 4, 8, 8, 0, 1, BackgroundStretch);
}
graphics.DisableAddBlend();
}