Beispiel #1
0
        /// <summary>
        /// Used to determine where to draw each HitError on the bar.
        /// </summary>
        /// <param name="error">The error time of the hit.</param>
        /// <returns></returns>
        private Vector2 GetErrorPixelPosition(int error)
        {
            JudgementValue judgement = Judgement.GetJudgementValueByError(Math.Abs(error));

            int baseX         = (int)(TruePosition.X + Size.X / 2);
            int sectionLength = getJudgePixelLength();
            int sectionX      = Judgement.Judgements.IndexOf(judgement) * sectionLength;
            int timeSize      = judgement.Judge - Judgement.GetPreviousJudgementValue(judgement).Judge;

            float judgePos = 0;

            if (timeSize > 0)
            {
                judgePos = (judgement.Judge - Math.Abs(error)) / (float)timeSize;
            }

            int errorX = (int)((sectionX + (1 - judgePos) * sectionLength) * Math.Sign(error));

            return(new Vector2(baseX - errorX, TruePosition.Y));
        }