public override void Draw(Camera camera, GameTime gameTime) { Matrix[] modelTransforms = new Matrix[Model.Bones.Count]; Model.CopyAbsoluteBoneTransformsTo(modelTransforms); Matrix playerModelScale = Matrix.CreateScale(ModelScaling); Matrix playerPositionScale = Matrix.CreateScale(1.0f / ModelScaling); Vector3 position3d = new Vector3(Position.Visual.X, 2.0f, Position.Visual.Y); Matrix position3dMatrix = Matrix.CreateTranslation(position3d); foreach (ModelMesh mesh in Model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.GraphicsDevice.DepthStencilState = DepthStencilState.Default; effect.World = (modelTransforms[mesh.ParentBone.Index] * playerModelScale) * position3dMatrix; effect.View = camera.ViewMatrix; effect.Projection = camera.ProjectionMatrix; } mesh.Draw(); } }
public override void Activate(bool instancePreserved) { worldMatrix = Matrix.Identity; ZIndex = -1; Map = new Map(); Map.Load(Path.Combine("Content", "Map.xml")); Player = new Player(this); Camera = new Camera(Player); Map.SmartAdd(Player); //Create HudScreen PlayerHUD playerHud = new PlayerHUD(Player) { ScreenPosition = ScreenPosition.Bottom, Size = new Vector2(600, 150) }; ScreenManager.AddScreen(playerHud); base.Activate(instancePreserved); LoadResources(); }
public override void Draw(Camera camera, GameTime gameTime) { }
public abstract void Draw(Camera camera, GameTime gameTime);