Exemplo n.º 1
0
        /// <summary>
        /// スタックから取り出す
        /// </summary>
        private void AddStock()
        {
            if (logs.Count >= TEXT_LIMIT)
            {
                return;
            }

            if (stockList.Count <= 0)
            {
                return;
            }


            if (logs.Count > 0)
            {
                LogText last     = logs[logs.Count - 1];
                Vector2 position = last.Position + new Vector2(0, HEIGHT);

                //背景レイヤーを超えた場合は処理しない
                if (position.Y > (window.GetOffsetPosition() + new Vector2(2, TEXT_LIMIT * HEIGHT)).Y)
                {
                    return;
                }

                stockList[0].Position = position;
            }
            else
            {
                Vector2 position = window.GetOffsetPosition() + new Vector2(2, 0);
                stockList[0].Position = position;
            }

            logs.Add(stockList[0]);
            stockList.RemoveAt(0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Logを追加
        /// </summary>
        /// <param name="log">Log情報</param>
        public void AddLog(string log)
        {
            Vector2 position = window.GetOffsetPosition() + new Vector2(2, logs.Count * HEIGHT);

            if (logs.Count > 0)
            {
                LogText last = logs[logs.Count - 1];
                position = last.Position + new Vector2(0, HEIGHT);
            }

            stockList.Add(new LogText(log, Color.White, position)); //スタックに追加
            window.Switch(true);                                    //Windowを開く
            window.SetAlpha(0.5f);                                  //透明度設定
        }