Scopeclass

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

objectScope
Namespace
global
Assembly
Sandbox.Engine
Declaration
public sealed struct Sandbox.TextRendering.Scope

Constructors1

Showing 1 constructors

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

ParameterTypeDescription
textstring
colorColor
sizefloat
font = Robotostring
weight = 400int

Methods1

Showing 1 methods

public Vector2 Measure()PUBLIC

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:Vector2A `Vector2` representing the width and height, in pixels, of the rendered text.

Properties1

Showing 1 properties

On this page