コード例 #1
0
ファイル: Portal.cs プロジェクト: sorke/GridDominance
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            CommonObstacleRenderer.DrawPortal(sbatch, _renderRects, Color, Normal);

#if DEBUG
            if (DebugSettings.Get("DebugEntityBoundaries"))
            {
                sbatch.FillCircle(Position, 4, 16, Color.Turquoise);
                sbatch.DrawLine(Position, Position + Vector2.UnitX.RotateWithLength(Normal, 32), Color.Turquoise, 2);
            }
#endif
        }
コード例 #2
0
ファイル: PortalStub.cs プロジェクト: sorke/GridDominance
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            if (GDOwner.Selection == this)
            {
                sbatch.FillShape(GetArea().AsInflated(GDConstants.TILE_WIDTH / 2, GDConstants.TILE_WIDTH / 2), Color.Black * 0.333f);
            }

            if (_ppCacheKey != EquatableTuple.Create(Length, Normal, Position))
            {
                _ppCacheKey   = EquatableTuple.Create(Length, Normal, Position);
                _ppCacheRects = CommonObstacleRenderer.CreatePortalRenderRects(Position, Vector2.UnitX.Rotate(Normal), Vector2.UnitX.Rotate(Normal).RotateWithLength(FloatMath.RAD_POS_090, Length / 2f), Length);
            }

            CommonObstacleRenderer.DrawPortal(sbatch, _ppCacheRects, Portal.COLORS[Group], Normal);
        }