Esempio n. 1
0
        /** スプライトインデックス。計算。
         */
        public void CalcTextIndex(TextList a_textlist)
        {
            //リセット。
            for (int ii = 0; ii < this.list.Length; ii++)
            {
                this.list[ii].ResetTextIndex();
            }

            //テキスト。
            {
                int       t_calc_mode      = 0;
                int       t_calc_layer     = 0;
                int       t_calc_index     = 0;
                LayerItem t_calc_layeritem = this.list[t_calc_layer];

                while (t_calc_index < a_textlist.GetListMax())
                {
                    Fee.Render2D.Text2D t_text = a_textlist.GetItem(t_calc_index);
                    int t_layerindex           = this.CalcLayerIndexFromDrawPriority(t_text.GetDrawPriority());

                    if (t_calc_layer < this.list.Length)
                    {
                        if (t_calc_mode == 0)
                        {
                            //開始インデックス。

                            if (t_layerindex < 0)
                            {
                                //除外。
                                t_calc_index++;
                            }
                            else
                            {
                                if (t_calc_layer == t_layerindex)
                                {
                                    //開始位置発見。
                                    t_calc_layeritem.text_index_start = t_calc_index;
                                    t_calc_layeritem.text_index_last  = t_calc_index;

                                    t_calc_index++;
                                    t_calc_mode = 1;
                                }
                                else
                                {
                                    //再チェック。
                                    t_calc_layeritem.text_index_start = -1;
                                    t_calc_layeritem.text_index_last  = -1;

                                    t_calc_layer++;
                                    t_calc_layeritem = this.list[t_calc_layer];
                                    t_calc_mode      = 0;
                                }
                            }
                        }
                        else
                        {
                            //終了インデックス。

                            if (t_calc_layer == t_layerindex)
                            {
                                //終了インデックス候補。
                                t_calc_layeritem.text_index_last = t_calc_index;
                                t_calc_index++;
                            }
                            else
                            {
                                //再チェック。
                                t_calc_layer++;
                                t_calc_layeritem = this.list[t_calc_layer];
                                t_calc_mode      = 0;
                            }
                        }
                    }
                }
            }
        }