Skip to main content

Struct YauiTexture

A texture registered for Yaui.YauiPrimitives. Reference counted: every acquisition needs a Yaui.YauiTexture.Release(), after which the value must not be used. Invalid after the stores shut down (domain reload), where releasing does nothing.

Assembly: Yaui.dll​
View Source​
Declaration
public readonly struct YauiTexture : IEquatable<YauiTexture>

Implements:
System.IEquatable<Yaui.YauiTexture>

Properties​

IsValid​

View Source​
Declaration
public bool IsValid { get; }

Texture​

View Source​
Declaration
public Texture Texture { get; }

Methods​

Acquire(Texture)​

Registers a texture sampled as a color image. Textures are never atlased.

View Source​
Declaration
public static YauiTexture Acquire(Texture texture)
Returns​

Yaui.YauiTexture

Parameters​
TypeName
Texturetexture

AcquireDistanceField(Texture, float)​

Registers a signed distance field atlas for Yaui.YauiPrimitive.DistanceField(Rect%2cYaui.YauiTexture%2cRect%2cColor): <code class="paramref">spread</code> is how far (in texels) the field reaches from the outline to 0 or 1. Acquire it again after the texture was resized, so that the shader sees the new size.

View Source​
Declaration
public static YauiTexture AcquireDistanceField(Texture texture, float spread)
Returns​

Yaui.YauiTexture

Parameters​
TypeName
Texturetexture
System.Singlespread

Release()​

View Source​
Declaration
public void Release()

Equals(YauiTexture)​

Indicates whether the current object is equal to another object of the same type.

View Source​
Declaration
public bool Equals(YauiTexture other)
Returns​

System.Boolean: true if the current object is equal to the <code class="paramref">other</code> parameter; otherwise, false.

Parameters​
TypeNameDescription
Yaui.YauiTextureotherAn object to compare with this object.

Equals(object)​

Indicates whether this instance and a specified object are equal.

View Source​
Declaration
public override bool Equals(object obj)
Returns​

System.Boolean: true if <code class="paramref">obj</code> and this instance are the same type and represent the same value; otherwise, false.

Parameters​
TypeNameDescription
System.ObjectobjThe object to compare with the current instance.

GetHashCode()​

Returns the hash code for this instance.

View Source​
Declaration
public override int GetHashCode()
Returns​

System.Int32: A 32-bit signed integer that is the hash code for this instance.

Implements​

  • System.IEquatable<Yaui.YauiTexture>