s&box docs

public sealed struct Sandbox.TextRendering.Scope

Defines a scope of text, all using the same style.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

public Scope(string text, Color color, float size, string font = Roboto, int weight = 400)

Parameters

  • font: Default: Roboto
  • weight: Default: 400

Methods

Showing 1 methods

public Vector2 Measure()

Measures the rendered size of the text in this `Sandbox.TextRendering.Scope` using its current style settings. This is non trivial but the underlying style is cached, so if you end up drawing it, it'll re-use the cached data anyway.

Returns

A `Vector2` representing the width and height, in pixels, of the rendered text.

Properties

Showing 1 properties

Metadata

FieldValue
Namespaceglobal
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.TextRendering.Scope

On this page