public override void Draw(SpriteBatch batch) { Base.Draw(batch); playrandom.Draw(batch); repeat.Draw(batch); stop.Draw(batch); pause.Draw(batch); play.Draw(batch); string np = string.Format("Now playing: {0}", NowPlaying ?? "nothing"); nowPlaying.text = np; nowPlaying.position = new Vector2(1366 - (nowPlaying.useFont.MeasureString(np).X + 15), 768 - 50); nowPlaying.Draw(batch); if (MediaPlayer.State != MediaState.Stopped) { download.np = NowPlaying; download.music = music; download.rect = new Rectangle(1366 - ((int)nowPlaying.useFont.MeasureString(np).X + 30 + 180), 768 - 65, 180, 50); download.Draw(batch); if (MouseTouching.RectWithIn(download.rect)) { message.Draw(batch); } } base.Draw(batch); }
private void DrawTooltip(object sender, EventArgs e) { if (displayEnabled) { if (screenCharacters.Count > 0 && Game1.activeClickableMenu == null) { foreach (Character c in screenCharacters.OrderBy(x => x.Position.Y)) { if (c == null || c == Game1.player || c == selectedCharacter) { continue; } Tooltip t = screenTooltipCache[c]; if (t.header.text == "" && t.body.text == "") { continue; } const int offset = -64; t.localX = c.GetBoundingBox().Center.X - Game1.viewport.X; t.localY = c.GetBoundingBox().Center.Y - Game1.viewport.Y + offset; t.Draw(Game1.spriteBatch, null); } } if (selectedCharacter != null && (tooltip.header.text != "" || tooltip.body.text != "")) { tooltip.localX = Game1.getMouseX(); tooltip.localY = Game1.getMouseY(); tooltip.Draw(Game1.spriteBatch, null); } } }
public void Draw(SpriteBatch sb) { sb.Draw(texture, displayLocation * Irbis.Irbis.screenScale, sourceRect, Color.White, 0f, Vector2.Zero, Irbis.Irbis.screenScale, SpriteEffects.None, drawDepth); if (!drawMenu && Irbis.Irbis.jamie != null && Irbis.Irbis.DistanceSquared(collider.Center, Irbis.Irbis.jamie.Collider.Center) <= Irbis.Irbis.vendingMachineUseDistanceSqr) { tooltip.Draw(sb); } }
public override void Draw(SpriteBatch batch) { batch.Draw(texture, rect, color); if (hovering) { tooltip.Draw(batch); } base.Draw(batch); }
public override void Draw(SpriteBatch spritebatch) { spritebatch.Draw(pixel, new Rectangle((int)Sh.Framework.Graphics.ShWindow.getWidth() - 1000, 0, 1000, (int)Sh.Framework.Graphics.ShWindow.getHeight()), Color.Black * 0.75f); if (MouseTouching.RectWithIn(new Rectangle((int)Sh.Framework.Graphics.ShWindow.getWidth() - 1000, 0, 1000, (int)Sh.Framework.Graphics.ShWindow.getHeight()))) { tt.Draw(spritebatch); } base.Draw(spritebatch); }
public void Draw(SpriteBatch sb) { if (Irbis.Irbis.debug >= 2) { sb.Draw(circle, position * Irbis.Irbis.screenScale, null, Color.White, 0f, new Vector2(ToolTipDistance * Irbis.Irbis.screenScale), 1, SpriteEffects.None, depth + 0.001f); } sb.Draw(texture, position * Irbis.Irbis.screenScale, null, Color.White, 0f, origin, Irbis.Irbis.screenScale, SpriteEffects.None, depth); if (drawTooltip && tooltip != null) { tooltip.Draw(sb); } }
public static void DrawActive() { if (activeTooltip != null) { if (activeTooltip.isSelected) { activeTooltip.Draw(); } else { activeTooltip = null; } } }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp); foreach (var component in _uicomponents) { component.Draw(gameTime, spriteBatch); } if (_activeCanvas != null) { _activeCanvas.Draw(gameTime, spriteBatch); } spriteBatch.End(); Ship.Draw(spriteBatch, ModeState.State.Build); if (_temporaryRoom != null) { spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp); _temporaryRoom.Draw(spriteBatch, Ship.Grid.Info); spriteBatch.End(); } if (_temporaryComponent != null && _drawTemporaryComponent) { spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp); _temporaryComponent.Draw(spriteBatch, Ship.Grid.Info); spriteBatch.End(); } spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp); if (_combatModeButton.Location.Intersects(new Rectangle((Mouse.GetState().Position), new Point(1, 1)))) { _hoveringCombatButton = true; if (!_combatModeButton.IsActive) { _tooltip.SetText("Invalid Ship!"); _tooltip.Show = true; } } else if (_hoveringCombatButton) { _hoveringCombatButton = false; _tooltip.Show = false; } _tooltip.Draw(gameTime, spriteBatch); spriteBatch.End(); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { Ship.Draw(spriteBatch, ModeState.State.Combat); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp); foreach (var component in _uicomponents) { component.Draw(gameTime, spriteBatch); } foreach (var projectile in projectiles) { projectile.Draw(spriteBatch); } foreach (UI_Component ui in _roomHealthBoxes.Values) { ui.Draw(gameTime, spriteBatch); } _tooltip.Draw(gameTime, spriteBatch); spriteBatch.End(); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { Game1.self.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); if (popupToDraw != null) { Darker.CurrentTechnique.Passes[0].Apply(); popupToDraw.Draw(spriteBatch); } Game1.self.spriteBatch.Draw(Game1.self.Wallpaper, new Vector2(0, 0), Color.White); switch (state) { case State.MainMenu: mainMenu.Draw(gameTime); break; case State.OptionsMenu: settingsMenu.Draw(gameTime); break; case State.LoginMenu: loginMenu.Draw(gameTime); break; case State.RegisterMenu: registerMenu.Draw(gameTime); break; case State.DeckMenu: deckMenu.Draw(gameTime); break; case State.GameWindow: gameWindow.Draw(gameTime); break; case State.ShopMenu: shopMenu.Draw(gameTime); break; case State.FleetMenu: fleetMenu.Draw(gameTime); break; case State.CardsMenu: cardsMenu.Draw(gameTime); break; } if (tooltipToDraw != null) { tooltipToDraw.Draw(spriteBatch); } base.Draw(gameTime); Game1.self.spriteBatch.End(); if (popupToDraw != null) { Game1.self.spriteBatch.Begin(); popupToDraw.Draw(spriteBatch); Game1.self.spriteBatch.End(); } }