Struct Sprite2DRendererOptions
A modifier component, when added alongside a Sprite2DRenderer it overrides the world space size computation.
Namespace: Unity.Tiny.Core2D
Syntax
[IdAlias("be2f221c9af74ec5c0a4495a2d6769a3")]
public struct Sprite2DRendererOptions : IComponentData
Remarks
Regular sprites have a base (untransformed) size that is computed as image asset size times sprite pixelsToWorldUnits. When this component is added to an entity the base size is set explicitly, and the image is placed inside that region depending on the repeat mode.
Fields
drawMode
Draw mode, defaults to ContinuousTiling. This mode specifies how the natural sized sprite is mapped into the new size.
Declaration
public DrawMode drawMode
Field Value
Type | Description |
---|---|
DrawMode |
size
Sprite size in world units
Declaration
public float2 size
Field Value
Type | Description |
---|---|
float2 |
Remarks
This is used to override the computed natural sprite size. The natural size is Image2D.imagePixelSize * Sprite2D.pixelsToWorldUnits * Sprite2D.imageRegion.size. The new size is also used in hit testing.
Properties
Default
Declaration
public static Sprite2DRendererOptions Default { get; }
Property Value
Type | Description |
---|---|
Sprite2DRendererOptions |