本文整理汇总了C#中DeltaEngine.Datatypes.Rectangle类的典型用法代码示例。如果您正苦于以下问题:C# Rectangle类的具体用法?C# Rectangle怎么用?C# Rectangle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Rectangle类属于DeltaEngine.Datatypes命名空间,在下文中一共展示了Rectangle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AdjustViewport
private void AdjustViewport(Vector2D point)
{
if (viewport == Rectangle.Zero)
viewport = new Rectangle(point, Size.Zero);
else
UpdateEdges(point);
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:AutogrowViewport.cs
示例2: MouseHoldTrigger
public MouseHoldTrigger(Rectangle holdArea, float holdTime = DefaultHoldTime,
MouseButton button = MouseButton.Left)
{
HoldArea = holdArea;
HoldTime = holdTime;
Button = button;
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:MouseHoldTrigger.cs
示例3: DrawRectangle
public override void DrawRectangle(Rectangle area)
{
Rectangle pixelRect = device.Screen.ToPixelSpace(area);
var sharpRect = new RectangleF(pixelRect.Left, pixelRect.Top, pixelRect.Right,
pixelRect.Bottom);
device.RenderTarget.FillRectangle(sharpRect, solidColorBrush);
}
开发者ID:lilinghui,项目名称:DeltaEngine,代码行数:7,代码来源:SharpDXDrawing.cs
示例4: ItemEffect
public ItemEffect(Material material, Rectangle drawArea, float duration)
: base(material, drawArea, duration)
{
RenderLayer = (int)RenderLayers.Items;
Add(new Damage { Interval = 0.25f });
Start<DoDamage>();
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:ItemEffect.cs
示例5: Bottom
public void Bottom()
{
var rect = new Rectangle(1, 2, 10, 20) { Bottom = 23 };
Assert.AreEqual(3, rect.Top);
Assert.AreEqual(23, rect.Bottom);
Assert.AreEqual(20, rect.Height);
}
开发者ID:remy22,项目名称:DeltaEngine,代码行数:7,代码来源:RectangleTests.cs
示例6: MoveSprite
private void MoveSprite()
{
float percentage = elapsed / timeout;
Point topLeft = Point.Lerp(startDrawArea.TopLeft, endDrawArea.TopLeft, percentage);
Size size = Size.Lerp(startDrawArea.Size, endDrawArea.Size, percentage);
DrawArea = new Rectangle(topLeft, size);
}
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:7,代码来源:ZoomingEffect.cs
示例7: CheckBounds
private bool CheckBounds(Rectangle view)
{
if (view.Left > DrawArea.Left) return false;
if (view.Right < DrawArea.Right) return false;
if (DrawArea.Top < 0) return false;
return view.Top + 0.05f <= DrawArea.Center.Y;
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:MovingSprite.cs
示例8: Clip
public void Clip(Rectangle clippingBounds)
{
var line = new ClippedLine(StartPoint, EndPoint, clippingBounds);
StartPoint = line.StartPoint;
EndPoint = line.EndPoint;
IsVisible = line.IsVisible;
}
开发者ID:remy22,项目名称:DeltaEngine,代码行数:7,代码来源:Line2D.cs
示例9: Label
internal Label(Theme theme, Material material, Rectangle drawArea)
: base(theme, material, drawArea)
{
var fontText = new FontText(theme.Font, "", GetFontTextDrawArea());
Add(fontText);
AddChild(fontText);
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:Label.cs
示例10: Polygon2D
public Polygon2D(Rectangle drawArea, Color color)
: base(drawArea)
{
Color = color;
Add(new List<Vector2D>());
OnDraw<DrawPolygon2D>();
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:Polygon2D.cs
示例11: CreateFromRectangle
public void CreateFromRectangle(Type resolver)
{
var halfScreenRect = new Rectangle(Point.Zero, Size.Half);
Rect box = null;
Start(resolver, (Renderer r) => r.Add(box = new Rect(halfScreenRect, Color.Red)),
() => Assert.AreEqual(Color.Red, box.Color));
}
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:7,代码来源:RectTests.cs
示例12: RecalculateUV
private static void RecalculateUV(Matrix matrix, Sprite entity, float angle)
{
var yScaled = RecalculateYCoordinate(matrix, angle);
var uv = new Rectangle(entity.UV.Left,
0.25f - ((1 - entity.UV.Height)) * yScaled, entity.UV.Width,
entity.UV.Height);
entity.UV = uv;
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:Sprite3DTests.cs
示例13: DeriveExtremities
private void DeriveExtremities()
{
float width = viewport.Width / (1 + 2 * Buffer);
float left = viewport.Center.X - width / 2;
float height = viewport.Height / (1 + 2 * Buffer);
float top = viewport.Center.Y - height / 2;
extremities = new Rectangle(left, top, width, height);
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:AutogrowViewport.cs
示例14: Slider
public Slider(Theme theme, Rectangle drawArea)
: base(theme, theme.Slider, drawArea)
{
var data = new Data { MinValue = 0, Value = 100, MaxValue = 100 };
Add(data);
Add(new Picture(theme, theme.SliderPointer, Rectangle.Unused));
AddChild(Pointer);
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:Slider.cs
示例15: ToQuadratic
private static Vector2D ToQuadratic(Vector2D point, Rectangle viewport, Rectangle drawArea)
{
float borderWidth = viewport.Width * Graph.Border;
float borderHeight = viewport.Height * Graph.Border;
float x = (point.X - viewport.Left + borderWidth) / (viewport.Width + 2 * borderWidth);
float y = (point.Y - viewport.Top + borderHeight) / (viewport.Height + 2 * borderHeight);
return new Vector2D(drawArea.Left + x * drawArea.Width, drawArea.Bottom - y * drawArea.Height);
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:RenderAxes.cs
示例16: ZoomingEffect
public ZoomingEffect(Image image, Rectangle startDrawArea, Rectangle endDrawArea,
float timeout = 1.0f)
: base(image, startDrawArea)
{
this.startDrawArea = startDrawArea;
this.endDrawArea = endDrawArea;
this.timeout = timeout;
}
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:8,代码来源:ZoomingEffect.cs
示例17: UpdateViewportFromExtremities
private void UpdateViewportFromExtremities()
{
float width = extremities.Width * (1 + 2 * Buffer);
float left = extremities.Center.X - width / 2;
float height = extremities.Height * (1 + 2 * Buffer);
float top = extremities.Center.Y - height / 2;
viewport = new Rectangle(left, top, width, height);
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:AutogrowViewport.cs
示例18: CreateOutlinedRectFromRectangle
public void CreateOutlinedRectFromRectangle(Type resolver)
{
var halfScreenRect = new Rectangle(Point.Zero, Size.Half);
OutlinedRect outlinedRect = null;
Start(resolver, (Renderer r) =>
r.Add(outlinedRect = new OutlinedRect(halfScreenRect, Color.Red)),
() => Assert.AreEqual(Color.Red, outlinedRect.Color));
}
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:8,代码来源:OutlinedRectTests.cs
示例19: GradientFilledRect
public GradientFilledRect(Rectangle drawArea, Color startColor, Color finalColor)
: base(drawArea)
{
Color = startColor;
FinalColor = finalColor;
UpdateCorners();
OnDraw<GradientRectRenderer>();
}
开发者ID:remy22,项目名称:DeltaEngine,代码行数:8,代码来源:GradientFilledRect.cs
示例20: SpawnAtRandomLocation
public void SpawnAtRandomLocation()
{
int x = random.Get(2, gridSize - 2);
int y = random.Get(2, gridSize - 2);
var newRandomPos = new Vector2D(x * blockSize, y * blockSize);
var newDrawArea = new Rectangle(newRandomPos, new Size(blockSize));
DrawArea = newDrawArea;
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:Chunk.cs
注:本文中的DeltaEngine.Datatypes.Rectangle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论