本文整理汇总了C#中Paddle.Getrect方法的典型用法代码示例。如果您正苦于以下问题:C# Paddle.Getrect方法的具体用法?C# Paddle.Getrect怎么用?C# Paddle.Getrect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paddle
的用法示例。
在下文中一共展示了Paddle.Getrect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(Paddle onPaddle, Graphics g)
{
Rectangle rct = new Rectangle(Point.Empty, onPaddle.Getrect().Size);
using (TextureBrush tb = new TextureBrush(drawimage, WrapMode.Tile,rct))
{
//calculate length to translate.
int translateamount = (int) (((float)drawimage.Width / 1000f) * DateTime.Now.Millisecond);
tb.TranslateTransform(translateamount, 0);
g.FillRectangle(tb, onPaddle.Getrect());
}
}
示例2: PerformFrame
public override void PerformFrame(BCBlockGameState gamestate, Paddle pPaddle)
{
var rg = BCBlockGameState.rgen;
base.PerformFrame(gamestate, pPaddle);
useoverlaybrush = new SolidBrush(new HSLColor(rg.NextDouble()*240, 240f, 120f));
//spawn a sparkle.
var paddlerect = pPaddle.Getrect();
PointF randompoint = new PointF(paddlerect.Left + (float) (paddlerect.Width*rg.NextDouble()),
paddlerect.Top + (float) (paddlerect.Height*rg.NextDouble()));
Sparkle s = new Sparkle(randompoint, BCBlockGameState.GetRandomVelocity(0, 2),
new HSLColor(rg.NextDouble()*240, 240, 120));
gamestate.NextFrameCalls.Enqueue(new BCBlockGameState.NextFrameStartup(() => gamestate.Particles.Add(s)));
}
示例3: TouchesPaddle
private bool TouchesPaddle(Paddle paddlecheck)
{
if (paddlecheck == null) return false;
return new RectangleF(Location, Size).IntersectsWith(paddlecheck.Getrect());
}
示例4: Draw
public override void Draw(Paddle onPaddle, Graphics g)
{
g.FillRectangle(useoverlaybrush, onPaddle.Getrect());
}