s&box docs
API ReferenceSandbox.UI

public class Sandbox.UI.Styles : Sandbox.UI.BaseStyles

Represents all supported CSS properties and their currently assigned values.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

Methods

Showing 14 methods

public bool ApplyAnimation(Sandbox.UI.Panel panel)

public void ApplyScale(float scale)

public Matrix BuildTransformMatrix(Vector2 size)

Creates a matrix based on this style's "transform" and other related properties

public virtual void Dirty()

public void ResetAnimation()

Stops the animation. If we have animation vars we'll start again.

public void StartAnimation(string name, float duration, int iterations = 1, float delay = 0, string timing = linear, string direction = normal, string fillmode = none)

Stop any previous animations and start this one. Make it last this long.

Parameters

  • iterations: Default: 1
  • delay: Default: 0
  • timing: Default: linear
  • direction: Default: normal
  • fillmode: Default: none

Properties

Showing 6 properties

public System.Nullable`1<Color> Sandbox.UI.Styles.BorderColor { get; set; }

public System.Nullable`1<Sandbox.UI.Length> Sandbox.UI.Styles.BorderWidth { get; set; }

public bool Sandbox.UI.Styles.HasBorder { get; set; }

public bool Sandbox.UI.Styles.HasTransitions { get; set; }

Whether this style sheet has any transitions that would need to be run.

public System.Nullable`1<Sandbox.UI.Length> Sandbox.UI.Styles.Padding { get; set; }

Metadata

FieldValue
NamespaceSandbox.UI
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.UI.Styles

On this page

Constructorspublic Styles()Methodspublic virtual System.Void Add(Sandbox.UI.BaseStyles bs)public System.Boolean ApplyAnimation(Sandbox.UI.Panel panel)public System.Void ApplyScale(System.Single scale)public Matrix BuildTransformMatrix(Vector2 size)public virtual System.Void Dirty()public virtual System.Void From(Sandbox.UI.BaseStyles bs)public virtual System.Void FromLerp(Sandbox.UI.BaseStyles from, Sandbox.UI.BaseStyles to, System.Single delta)public Sandbox.UI.Margin GetInset(Vector2 size)public Sandbox.UI.Margin GetOutset(Vector2 size)public virtual System.Void LerpProperty(System.String name, Sandbox.UI.BaseStyles from, Sandbox.UI.BaseStyles to, System.Single delta)public System.Void ResetAnimation()public virtual System.Boolean Set(System.String property, System.String value)public System.Boolean Set(System.String styles)public System.Void StartAnimation(System.String name, System.Single duration, System.Int32 iterations = 1, System.Single delay = 0, System.String timing = linear, System.String direction = normal, System.String fillmode = none)Propertiespublic System.Nullable`1<Color> Sandbox.UI.Styles.BorderColor { get; set; }public System.Nullable`1<Sandbox.UI.Length> Sandbox.UI.Styles.BorderWidth { get; set; }public System.Boolean Sandbox.UI.Styles.HasBorder { get; set; }public System.Boolean Sandbox.UI.Styles.HasTransitions { get; set; }public System.Nullable`1<Sandbox.UI.Length> Sandbox.UI.Styles.Margin { get; set; }public System.Nullable`1<Sandbox.UI.Length> Sandbox.UI.Styles.Padding { get; set; }Metadata