private void OnRenderingWorld(object sender, RenderingWorldEventArgs e) { SpriteBatch spriteBatch = e.SpriteBatch; Rectangle viewPort = Game1.viewport.ToXna(); Vector2 origin = new Vector2(-viewPort.Center.X / 8, -viewPort.Center.Y / 8) * Game1.options.zoomLevel; float scale = 4f; spriteBatch.Draw(skyTexture, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.8f); spriteBatch.Draw(texture, origin, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 1f); //debug warp custom_ridgeside_rsvcliff }
private void OnRenderingWorld(object sender, RenderingWorldEventArgs e) { if (Game1.background is SpaceBackground) { // This part doesn't do anything normally (https://github.com/MonoGame/MonoGame/issues/5441), // but SpriteMaster makes it work. So need this for compatibility. if (Game1.graphics.PreferredDepthStencilFormat != DepthFormat.Depth24Stencil8) { Game1.graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8; Game1.graphics.ApplyChanges(); } DefaultStencilOverride = StencilDarken; Game1.graphics.GraphicsDevice.Clear(ClearOptions.Stencil, Color.Transparent, 0, 0); } }
private void Display_RenderingWorld(object sender, RenderingWorldEventArgs e) { if (!Context.IsWorldReady) { return; } try { minigame.Value.Display_RenderingWorld(sender, e); } catch (Exception ex) { Monitor.Log("Handled Exception in RenderedWorld. Festival: " + Game1.isFestival() + ", Message: " + ex.Message + " in: " + exception.Match(ex.StackTrace).Value, LogLevel.Trace); minigame.Value.EmergencyCancel(); } }
private void Display_RenderingWorld(object sender, RenderingWorldEventArgs e) { if (!Config.EnableMod) { return; } if (Config.AllowOthersToPick) { foreach (Farmer farmer in Game1.getAllFarmers()) { var loc = farmer.Position + new Vector2(32, -88); if (Game1.player.currentLocation == farmer.currentLocation && farmer.hat.Value is not null && Vector2.Distance(Game1.GlobalToLocal(loc), Game1.getMousePosition().ToVector2()) < 32 && farmer.hat.Value.modData.ContainsKey(seedKey)) { if (ReadyToHarvest(farmer.hat.Value)) { Game1.mouseCursor = 6; if (!Utility.withinRadiusOfPlayer((int)farmer.Position.X, (int)farmer.Position.Y, 1, Game1.player)) { Game1.mouseCursorTransparency = 0.5f; } } } } } else { var loc = Game1.player.Position + new Vector2(32, -88); if (Vector2.Distance(Game1.GlobalToLocal(loc), Game1.getMousePosition().ToVector2()) < 32 && Game1.player.hat.Value is not null && Game1.player.hat.Value.modData.TryGetValue(phaseKey, out string phaseString)) { if (ReadyToHarvest(Game1.player.hat.Value)) { Game1.mouseCursor = 6; } } } }
private void Display_RenderingWorld(object sender, RenderingWorldEventArgs e) { throw new NotImplementedException(); }
/// <summary>Raised before the game world is drawn to the screen. This event isn't useful for drawing to the screen, since the game will draw over it.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> protected virtual void OnRenderingWorld(object sender, RenderingWorldEventArgs e) { }