Exemplo n.º 1
0
        void AdjustStaffScale(VoiceLayout.ScoreLine scoreLine)
        {
            var currentStaff = scoreLine.container.transform.GetChild(0);
            var currentWidth = currentStaff.GetComponent <SpriteRenderer>().bounds.size.x;
            var scaleX       = scoreLine.insertX / currentWidth;

            currentStaff.transform.localScale = new Vector3(scaleX, 1.0f, 1.0f);
        }
Exemplo n.º 2
0
        void LayoutTimeSignature(VoiceLayout.ScoreLine scoreLine, string timeSignature)
        {
            var container = new GameObject("Time Signature");

            container.transform.parent = scoreLine.container.transform;

            var timeSignatureInfo = notes.CreateTimeSignature(timeSignature, container);

            container.transform.localPosition = scoreLine.insertPos;
            scoreLine.EncapsulateAppendedBounds(timeSignatureInfo.totalBounding);
        }
Exemplo n.º 3
0
        void LayoutStaff(VoiceLayout.ScoreLine scoreLine, ABC.Clef clef)
        {
            var staffSprite = cache.GetSpriteObject("Staff");

            staffSprite.transform.parent        = scoreLine.container.transform;
            staffSprite.transform.localPosition = scoreLine.insertPos;
            scoreLine.bounds = staffSprite.bounds;

            scoreLine.AdvaceInsertPos(staffPadding);
            var clefSprite = cache.GetSpriteObject($"Clef_{clef}");

            clefSprite.transform.parent        = scoreLine.container.transform;
            clefSprite.transform.localPosition = scoreLine.insertPos;
            scoreLine.bounds.Encapsulate(clefSprite.bounds);
            scoreLine.AdvaceInsertPos(staffPadding);
        }