コード例 #1
0
ファイル: EditorLayer.cs プロジェクト: alex4401/Hydra
        public void BeforeActorsRender(IDrawingContext context)
        {
            var allocVector = new Vector2D(_drawingArea.Allocation.Width, _drawingArea.Allocation.Height);

            context.DrawRect(Vector2D.Zero, allocVector, _defaultColor);

            _frameStartTime = DateTimeOffset.Now.ToUnixTimeMilliseconds();
#if DEBUG
            context.Restrict(HeadSize);
#endif
        }
コード例 #2
0
        protected override void OnRender(IDrawingContext context, Rect bounds, double opacity)
        {
            base.OnRender(context, bounds, opacity);

            Rectangle rectangle = WpfElement as Rectangle;

            DrawingStyle style = DrawingStyle.FromElement(this);

            style.Fill            = rectangle.Fill;
            style.Stroke          = rectangle.Stroke;
            style.StrokeThickness = new Thickness(rectangle.StrokeThickness);
            style.Opacity         = opacity;

            context.DrawRect(bounds, style);
        }
コード例 #3
0
        protected override void OnRender(IDrawingContext context, Rect bounds, double opacity)
        {
            base.OnRender(context, bounds, opacity);

            Border border = WpfElement as Border;

            DrawingStyle style = DrawingStyle.FromElement(this);

            style.CornerRadius    = border.CornerRadius;
            style.Fill            = border.Background;
            style.Stroke          = border.BorderBrush;
            style.StrokeThickness = border.BorderThickness;
            style.Opacity         = opacity;

            context.DrawRect(bounds, style);

            if (border.ClipToBounds)
            {
                context.ClipRect(bounds, border.CornerRadius);
            }
        }
コード例 #4
0
ファイル: ASquare.cs プロジェクト: alex4401/Hydra
 public override void OnRender(IDrawingContext context)
 {
     context.DrawRect(Location, Size, FillColor);
 }
コード例 #5
0
ファイル: AHeadRoot.cs プロジェクト: alex4401/Hydra
 public override void OnRender(IDrawingContext context)
 {
     context.DrawRect(Vector2D.Zero, new Vector2D(context.GetViewportWidth(), context.GetViewportHeight()), Color3.Black);
 }