Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 public override void Draw(Camera camera, GameTime gameTime)
 {
 }
Esempio n. 4
0
 public abstract void Draw(Camera camera, GameTime gameTime);