public override void PreDraw(Scene scene) { base.PreDraw(scene); scene.PushSpriteBatch(blendState: scene.NonPremultiplied, samplerState: SamplerState.PointWrap, projection: Projection); scene.GraphicsDevice.Clear(Color.TransparentBlack); Text.Draw(new Vector2(0, -Scroll), FontRenderer); scene.PopSpriteBatch(); }
public override void Draw(SceneGame scene, DrawPass pass) { var offset = new Vector2(0, -32 * (float)LerpHelper.QuadraticOut(0, 1, Frame.GetSubSlide(0, 20))); if (FlickerTime < 0.5f) { Text.Draw(Position + offset, World.FontRenderer, Matrix.CreateScale(new Vector3(2, 2, 0))); } }
public virtual void Draw(FontRenderer fontRenderer, int x, int y, float openCoeff) { if (openCoeff <= 0) { return; } var rectInterior = new Rectangle(new Point(x, y), Size()); float openResize = MathHelper.Lerp(-0.5f, 0.0f, openCoeff); rectInterior.Inflate(rectInterior.Width * openResize, rectInterior.Height * openResize); var minWidth = rectInterior.Width * 2 / 3; fontRenderer.Scene.DrawUI(ContentSprite, rectInterior, Color.White); if (!Label.IsEmpty() && openCoeff >= 1) { var width = (int)MathHelper.Clamp(Label.GetContentWidth() + 8, minWidth, rectInterior.Width); Rectangle rectExterior = new Rectangle(rectInterior.X + (rectInterior.Width - width) / 2, rectInterior.Y - 20, width, 16); fontRenderer.Scene.DrawUI(LabelSprite, rectExterior, Color.White); Label.Draw(new Vector2(rectExterior.X, rectExterior.Y), fontRenderer); } }
private void DrawTooltip() { if (TooltipText != null && !TooltipText.IsEmpty()) { SpriteReference ui_tooltip = SpriteLoader.Instance.AddSprite("content/ui_box"); int tooltipWidth = (int)TooltipText.GetContentWidth(); int screenWidth = Viewport.Width - 8 - InputState.MouseX + 4; bool invert = false; if (tooltipWidth > screenWidth) { screenWidth = Viewport.Width - screenWidth; invert = true; } int tooltipHeight = (int)TooltipText.GetContentHeight(); int tooltipX = InputState.MouseX + 4; int tooltipY = Math.Max(0, InputState.MouseY - 4 - tooltipHeight); if (invert) { tooltipX -= tooltipWidth; } DrawUI(ui_tooltip, new Rectangle(tooltipX - 2, tooltipY - 2, tooltipWidth + 4, tooltipHeight + 4), Color.White); TooltipText.Draw(new Vector2(tooltipX, tooltipY), FontRenderer); } }
public override void Draw(FontRenderer fontRenderer, int x, int y, float openCoeff) { base.Draw(fontRenderer, x, y, openCoeff); Content.Draw(new Vector2(x, y), fontRenderer); }
public override void Draw(GameTime gameTime) { PushSpriteBatch(); LoadingText.Draw(new Vector2(Viewport.Width / 2, Viewport.Height / 2), FontRenderer); PopSpriteBatch(); }