コード例 #1
0
ファイル: TrackRenderer2D.cs プロジェクト: guusw/fx2
 protected override TrackRendererData CreateSplitData(TimeDivisionReference tdr)
 {
     return(new RenderData2D(this, new Box
     {
         Texture = SplitTexture,
         Origin = Anchor.BottomCentre,
         RelativePositionAxes = Axes.Both,
         Position = new Vector2(0.5f, 0.0f),
         RelativeSizeAxes = Axes.X,
         Size = new Vector2(1, 0),
         EdgeSmoothness = Vector2.Zero,
         Depth = 3.0f,
         Alpha = (tdr.Position.Numerator == 0) ? 1.0f : 0.5f
     }));
 }
コード例 #2
0
        /// <summary>
        /// Adds or updates a new visible split to be rendered
        /// </summary>
        /// <param name="tdr">The time of this split</param>
        public void UpdateSplit(TimeDivisionReference tdr)
        {
            TrackRendererData existing;

            if (!splitObjects.TryGetValue(tdr, out existing))
            {
                existing = CreateSplitData(tdr);
                if (existing == null)
                {
                    return;
                }
                splitObjects.Add(tdr, existing);
            }
            else
            {
                pendingSplitRemovals.Remove(tdr);
            }

            existing.Update(GetPosition(tdr.AbsolutePosition));
        }
コード例 #3
0
 protected abstract TrackRendererData CreateSplitData(TimeDivisionReference tdr);