예제 #1
0
        private void UpdateLayer(ILayer <IPrimitive> layer, SizeF size)
        {
            layer.Clear();
            //TODO:根据背景属性,添加背景图元

            //TODO:根据显示区域大小,添加网格线
        }
        public void Render(TimeSpan elapsedGameTime)
        {
            mainLayer.Begin();

            mainLayer.Clear();
            mainLayer.Save();
            mainLayer.Translate(0, 61);
            mainLayer.DrawImage(Barrier, BarrierPosition);
            mainLayer.DrawImage(RedWalkway, WalkwayPosition);



            this.ticking += 2;

            mainLayer.Save();

            var person = _renderer.GetImage("female.blonde.front");

            mainLayer.Translate((-this.ticking + (_width * 100)) % _width, 50);


            double rotate;

            rotate = this.ticking % 30 < 15 ? .07 : -.07;
            mainLayer.DrawImage(person, -person.Width / 2, -person.Height / 2, rotate, person.Center);

            mainLayer.Restore();


            mainLayer.Save();

            person = _renderer.GetImage("male.hat.front");
            mainLayer.Translate((this.ticking + (_width * 100)) % _width, 100);

            rotate = this.ticking % 30 < 15 ? .07 : -.07;



            mainLayer.SetDrawingEffects(DrawingEffects.FlipHorizontally);
            mainLayer.DrawImage(person, -person.Width / 2, -person.Height / 2, rotate, person.Center);
            mainLayer.Restore();



            mainLayer.Restore();
            mainLayer.End();
        }
예제 #3
0
        public void Render(TimeSpan elapsedGameTime)
        {
            mainLayer.Begin();

            mainLayer.Save();
            mainLayer.Clear();

            if (helloWorldAnimation != null)
            {
                helloWorldAnimation.Render(mainLayer);
            }
            if (State.ShowWelcome)
            {
                if (welcomeAnimation != null)
                {
                    welcomeAnimation.Render(mainLayer);
                }
            }

            mainLayer.Restore();

            mainLayer.End();
        }
예제 #4
0
 public void Clear()
 {
     __layer.Clear();
 }