示例#1
0
        public virtual void DrawOverModel(RenderContext context, GameModel model)
        {
            var camera = context.Camera;
            Vector3 center = context.GraphicsDevice.Viewport.Project(new Vector3(model.Position,0), camera.Projection, camera.View, Matrix.Identity);
            Position = new Vector2(center.X - Width/2, center.Y - Height/2);

            context.SpriteBatch.Begin();
            context.SpriteBatch.Draw(m_Texture, Position, DrawRect, new Color(Color.R, Color.G, Color.B, 1.0f), MathHelper.ToRadians(Rotation), Vector2.Zero, ObjectScale, Effect, 1);
            context.SpriteBatch.End();

            context.Graphics.GraphicsDevice.DepthStencilState = DepthStencilState.Default;
        }
示例#2
0
文件: Particle.cs 项目: TobieD/Glide
        public void Update(float dt,RenderContext context,GameModel model)
        {
            //Project onto a model
            var camera = context.Camera;
            Vector3 center = context.GraphicsDevice.Viewport.Project(new Vector3(model.Position, 0), camera.Projection, camera.View, Matrix.Identity);
            Position = new Vector2(center.X, center.Y);

            Velocity += Acceleration * dt;
            Position += Velocity * dt;

            //Position.Y += 120 * dt;

            Rotation += RotSpeed * dt;
            TimeSinceStart += dt;
        }
示例#3
0
 /// <summary>
 /// overriden from DrawableGameComponent, Update will update all of the active
 /// particles.
 /// </summary>
 /// 
 public void SetProjectionSettings(RenderContext context, GameModel model)
 {
     m_RenderContext = context;
     m_Model = model;
 }
示例#4
0
文件: LevelList.cs 项目: TobieD/Glide
 protected void RemoveChild(GameModel child)
 {
     m_Child.Remove(child);
     child = null;
 }
示例#5
0
文件: LevelList.cs 项目: TobieD/Glide
 protected void AddChild(GameModel child)
 {
     if (child != null)
         m_Child.Add(child);
 }