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
public readonly struct YauiTexture : IEquatable<YauiTexture>
Implements:
System.IEquatable<Yaui.YauiTexture>
Properties
IsValid
View Source
public bool IsValid { get; }
Texture
View Source
public Texture Texture { get; }
Methods
Acquire(Texture)
Registers a texture sampled as a color image. Textures are never atlased.
View Source
public static YauiTexture Acquire(Texture texture)
Returns
Parameters
| Type | Name |
|---|---|
Texture | texture |
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
public static YauiTexture AcquireDistanceField(Texture texture, float spread)
Returns
Parameters
| Type | Name |
|---|---|
Texture | texture |
System.Single | spread |
Release()
View Source
public void Release()
Equals(YauiTexture)
Indicates whether the current object is equal to another object of the same type.
View Source
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
| Type | Name | Description |
|---|---|---|
| Yaui.YauiTexture | other | An object to compare with this object. |
Equals(object)
Indicates whether this instance and a specified object are equal.
View Source
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
| Type | Name | Description |
|---|---|---|
System.Object | obj | The object to compare with the current instance. |
GetHashCode()
Returns the hash code for this instance.
View Source
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>