/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here Console.WriteLine( GraphicsDevice.Viewport.X); cam = new Camera(new Viewport(0, 0, 256 * (int)Global.zoom, 174 * (int)Global.zoom)); base.Initialize(); }
public void draw(SpriteBatch sprite,Camera cam,WorldScreen screen) { sprite.End(); sprite.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null); sprite.Draw(texture,new Vector2(0,0),new Rectangle(0,0,texture.Width,texture.Height),Color.White,0f,Vector2.Zero,Global.zoom,SpriteEffects.None,1f); drawlife(sprite,screen); sprite.End(); sprite.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null,cam.Transform); }
internal void UpdateCam(Camera cam) { this.cam = cam; }