예제 #1
0
    /// <summary>開始タグ適用</summary>
    private void applyStartTag(TagReader.StartTag aTag)
    {
        switch (aTag.mTagName)
        {
        case "size":
            mCurrentFontHeight = float.Parse(aTag.mArguments[0]);
            break;

        case "color":
            mCurrentFontColor = makeColor(aTag.mArguments);
            break;

        case "br":
            createNewLine();
            break;

        case "u":
            if (aTag.mArguments.Length == 0)
            {
                createUnderline(0.1f);
            }
            else
            {
                createUnderline(float.Parse(aTag.mArguments[0]));
            }
            break;

        case "image":
            ImageElement tImageElement = ImageElement.create(aTag.mArguments[0], this);
            addLast(tImageElement);
            break;

        case "reading":
        case "collider":
            mCurrentColliderArgument = aTag.mArguments[0];
            break;

        case "highlight":
            //触れた時の引数
            mCurrentColliderArgument = aTag.mArguments[0];
            //色
            string[] tCp = new string[aTag.mArguments.Length - 1];
            Array.Copy(aTag.mArguments, tCp, aTag.mArguments.Length - 1);
            mCurrentFontColor = makeColor(tCp);
            break;

        case "link":
            //触れた時の引数
            mCurrentColliderArgument = aTag.mArguments[0];
            //色
            string[] tCp2 = new string[aTag.mArguments.Length - 1];
            Array.Copy(aTag.mArguments, tCp2, aTag.mArguments.Length - 1);
            mCurrentFontColor = makeColor(tCp2);
            //アンダーライン
            if (aTag.mArguments.Length < 6)
            {
                createUnderline(0.1f);
            }
            else
            {
                createUnderline(float.Parse(aTag.mArguments[0]));
            }
            break;

        case "animation":
            mCurrentAnimate = aTag;
            break;
        }
    }