示例#1
0
        public void Update(GameTime gametime)
        {
            switch (_state)
            {
            case BillboardStateEnum.Drop:
                _fontY += 10;
                if (_fontY >= 200)
                {
                    _fontY = 200;
                    _counter.Start();
                }

                if (_counter.ElapsedMilliseconds >= 1500)
                {
                    _state = BillboardStateEnum.Rise;
                    _counter.Stop();
                    _counter.Reset();
                }
                break;

            case BillboardStateEnum.Rise:
                _fontY -= 10;
                if (_fontY <= -200)
                {
                    _fontY = -200;
                }
                break;
            }
        }
示例#2
0
 public void StartBillBoard(string text)
 {
     _titles.Text = text;
     _fontY       = -200;
     _state       = BillboardStateEnum.Drop;
 }