Exemple #1
0
    // ================================================================ //

    public void             create()
    {
        Navi navi = Navi.get();

        //

        this.root_sprite = Sprite2DRoot.get().createNull();
        this.root_sprite.setPosition(new Vector3(0.0f, POSITION_Y, 0.0f));

        // 아이콘, 문자 오브젝트 생성.

        this.icon = new Yell.Icon();
        this.icon.create(this.icon_texture);
        this.icon.sprite.transform.parent = this.root_sprite.transform;

        //

        this.mojis = new List <Yell.Moji>();

        for (int i = 0; i < this.yell_words.Length; i++)
        {
            YellFontData font_data = navi.getYellFontData(this.yell_words[i]);

            Yell.Moji moji = new Yell.Moji();

            moji.create(font_data.texture, this.moji_mae_texture);

            if (font_data.is_small)
            {
                moji.moji_mae_scale *= 0.5f;
            }
            moji.yell  = this;
            moji.index = i;
            moji.sprite.transform.parent = this.root_sprite.transform;
            moji.reset();

            if (i % 3 == 0)
            {
                moji.sprite.setVertexColor(new Color(1.0f, 1.0f, 0.5f));
            }
            else if (i % 3 == 1)
            {
                moji.sprite.setVertexColor(new Color(1.0f, 0.7f, 0.7f));
            }
            else if (i % 3 == 2)
            {
                moji.sprite.setVertexColor(new Color(0.3f, 1.0f, 1.0f));
            }

            this.mojis.Add(moji);
        }

        this.icon.sprite.setDepth(this.mojis[this.mojis.Count - 1].sprite.getDepth() - 0.1f);

        // 문자 위치.

        float   pitch = 54.0f;
        Vector2 p0    = Vector2.zero;
        Vector2 p1    = Vector2.zero;

        p0.x = (float)this.mojis.Count * pitch / 2.0f;
        p0.y = 0.0f;

        p1.x = 0.0f - ((float)this.mojis.Count) * pitch / 2.0f - pitch / 2.0f;
        p1.y = p0.y;

        this.icon.p0 = p0;
        this.icon.p1 = p1;
        p1.x        += pitch;

        p0.x = p1.x;

        for (int i = 0; i < this.mojis.Count; i++)
        {
            YellFontData font_data = navi.getYellFontData(this.yell_words[i]);

            this.mojis[i].p0 = p0;
            this.mojis[i].reset();

            if (font_data.is_small)
            {
                this.mojis[i].p0.x -= pitch * 0.25f;
                this.mojis[i].p0.y -= pitch * 0.25f;

                p0.x += pitch * 0.5f;
            }
            else
            {
                p0.x += pitch;
            }
        }
    }