public void Draw(GameTime gametime, GraphicsDevice graphicsDevice, Effect effect, Camera camera) { //foreach (ModelMesh mesh in this._Model.Meshes) //{ // foreach (BasicEffect eff in mesh.Effects) // { // eff.EnableDefaultLighting(); // eff.TextureEnabled = true; // eff.LightingEnabled = true; // eff.World = Matrix.Identity * Matrix.CreateScale(this._Scale) * Matrix.CreateTranslation(new Vector3(this._PositionX, this._PositionY, this._PositionZ)); // eff.View = camera.View; // eff.Projection = camera.Projection; // } // mesh.Draw(); //} foreach (ModelMesh mesh in this._Model.Meshes) { foreach (SkinnedEffect eff in mesh.Effects) { eff.SetBoneTransforms(this._Bones); eff.World = Matrix.CreateTranslation(Position); eff.View = camera.View; eff.Projection = camera.Projection; eff.EnableDefaultLighting(); eff.SpecularColor = new Vector3(0.25f); eff.SpecularPower = 16; } mesh.Draw(); } }
public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Effect effect, Camera camera) { this._VideoFrame.UpdateFrame(_VideoPlayer, new Vector2(graphicsDevice.Viewport.X, graphicsDevice.Viewport.Y), new Vector2(graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height)); this._VideoFrame.Draw(gameTime, graphicsDevice, spriteBatch, null, camera); }
public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Effect effect, Camera camera) { _Ground.Draw(gameTime, graphicsDevice, spriteBatch, effect, _Camera); //_PlayerCharacter.Draw(gameTime, graphicsDevice, spriteBatch, effect, _Camera); _ComputerCharacter.Draw(gameTime, graphicsDevice, spriteBatch, effect, _Camera); this.DrawCordinate(graphicsDevice); }
public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Effect effect, Camera camera) { if (this._MainMenuVideoPlayer.GetVideoPlayerState() != MediaState.Stopped) { this._MainMenuVideoPlayer.Draw(gameTime, graphicsDevice, spriteBatch, null, camera); } this._Title.Draw(gameTime, graphicsDevice, spriteBatch, effect, camera); for(int i=0; i<_nButton; i++) { _ButtonList[i].Draw(gameTime, graphicsDevice, spriteBatch, effect, camera); } }
public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Effect effect, Camera camera) { Rectangle screen = new Rectangle((int)this._TopLeft.X, (int)this._TopLeft.Y, (int)this._Size.X, (int)this._Size.Y); if(this._VideoTexture != null) { spriteBatch.Begin(); spriteBatch.Draw(this._VideoTexture, screen, Color.White); spriteBatch.End(); } }
//private MAP //chua co map :D public Stage(ContentManager content, My3DGameCharacter playerCharacter, My3DGameCharacter computerCharacter, string MapName) { _PlayerCharacter = playerCharacter; _ComputerCharacter = computerCharacter; _Ground = new PlanarModel(content, "Map\\Ground", new Vector2(50, 50), 1f, new Vector3(0, 0, 0), Matrix.Identity); _Ground.IsAnimate = false; _Camera = new PerspectiveCamera( this.CAMERAPOSITION, this.CAMERATARGET, this.CAMERAUPVECTOR, this.NEARPLANEDISTANCE, this.FARPLANEDISTANCE, this.FIELDOFVIEW, this.ASPECTRATIO); }
public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Effect effect, Camera camera) { graphicsDevice.RasterizerState = RasterizerState.CullNone; MyEffect.CurrentTechnique = MyEffect.Techniques["Technique1"]; MyEffect.Parameters["World"].SetValue(Matrix.CreateScale(this.Scale) * this.Rotation * Matrix.CreateTranslation(this.Position)); MyEffect.Parameters["View"].SetValue(camera.View); MyEffect.Parameters["Projection"].SetValue(camera.Projection); MyEffect.Parameters["Texture"].SetValue(_Texture); foreach (EffectPass pass in MyEffect.CurrentTechnique.Passes) { pass.Apply(); graphicsDevice.DrawUserPrimitives<VertexPositionTexture>(PrimitiveType.TriangleList, this._Vertices, 0, 2, VertexPositionTexture.VertexDeclaration); } }
public virtual void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Effect effect, Camera camera) { }
public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Effect effect, Camera camera) { _TerrainModel.Draw(gameTime, graphicsDevice, spriteBatch, effect, camera); }
public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Effect effect, Camera camera) { if (this._MainMenuVideoPlayer.GetVideoPlayerState() != MediaState.Stopped) { this._MainMenuVideoPlayer.Draw(gameTime, graphicsDevice, spriteBatch, null, camera); } _PlanarTitle.Draw(gameTime, graphicsDevice, spriteBatch, effect, camera); for(int i=0; i<_nButton; i++) { _ButtonList[i].Draw(gameTime, graphicsDevice, spriteBatch, effect, camera); } //volume bar for(int i=0; i<_volume; i++) { _PlanarPartOfBar.Position = new Vector3(_OriginalPositionBar.X + BALL_DISTANCE * i, _ButtonList[0].Position.Y, 0); _PlanarPartOfBar.IsAnimate = true; _PlanarPartOfBar.Draw(gameTime, graphicsDevice, spriteBatch, effect, camera); } //difficuty bar for (int i = 0; i < _difficuty; i++) { _PlanarPartOfBar.Position = new Vector3(_OriginalPositionBar.X + BALL_DISTANCE * i, _ButtonList[1].Position.Y, 0); _PlanarPartOfBar.IsAnimate = true; _PlanarPartOfBar.Draw(gameTime, graphicsDevice, spriteBatch, effect, camera); } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here string[] textures = { "New Game", "Option", "Exit" }; Vector3[] positions = { new Vector3(0, -10, 0), new Vector3(0, -45, 0), new Vector3(0, -80, 0), }; string texturePrefix = "MainMenu\\"; Vector2[] sizes = { new Vector2(130, 60/2), new Vector2(130, 60/2), new Vector2(130, 60/2) }; _MainMenu = new MainMenu(Content, texturePrefix, textures, positions, sizes); string[] textures1 = { "Option", "SoundVolume", "Difficuty", "Back", "Ball" }; Vector3[] positions1 = { new Vector3(0, 60, 0), new Vector3(-40, 0, 0), new Vector3(-40, -40, 0), new Vector3(0, -80, 0), new Vector3(35, 0, 0), }; string texturePrefix1 = "OptionMenu\\"; Vector2[] sizes1 = { new Vector2(260/2, 52/2), new Vector2(220/2, 52/2), new Vector2(220/2, 52/2), new Vector2(260/2, 52/2), new Vector2(20, 30) }; this._OptionMenus = new OptionMenu(Content, texturePrefix1, textures1, positions1, sizes1); this._camera = new PerspectiveCamera( this.CAMERAPOSITION, this.CAMERATARGET, this.CAMERAUPVECTOR, this.NEARPLANEDISTANCE, this.FARPLANEDISTANCE, this.FIELDOFVIEW, this.ASPECTRATIO); this._SkinnedEffect = new SkinnedEffect(GraphicsDevice); }