C# Class Spine.Unity.Modules.AttachmentTools.AttachmentRegionExtensions

Show file Open project: EsotericSoftware/spine-runtimes

Public Methods

Method Description
GetRegion ( this attachment ) : AtlasRegion

Tries to get the region (image) of a renderable attachment. If the attachment is not renderable, it returns null.

SetPositionOffset ( this regionAttachment, Vector2 offset ) : void

Sets the position offset. Call regionAttachment.UpdateOffset to apply the change.

SetPositionOffset ( this regionAttachment, float x, float y ) : void

Sets the position offset. Call regionAttachment.UpdateOffset to apply the change.

SetRegion ( this attachment, AtlasRegion region, bool updateOffset = true ) : void

Tries to set the region (image) of a renderable attachment. If the attachment is not renderable, nothing is applied.

SetRotation ( this regionAttachment, float rotation ) : void

Sets the rotation. Call regionAttachment.UpdateOffset to apply the change.

SetScale ( this regionAttachment, Vector2 scale ) : void

Sets the scale. Call regionAttachment.UpdateOffset to apply the change.

SetScale ( this regionAttachment, float x, float y ) : void

Sets the scale. Call regionAttachment.UpdateOffset to apply the change.

ToRegionAttachment ( this sprite, AtlasPage page ) : RegionAttachment

Creates a RegionAttachment based on a sprite. This method creates a real, usable AtlasRegion. That AtlasRegion uses the AtlasPage provided.///

ToRegionAttachment ( this sprite, Material material ) : RegionAttachment

Creates a RegionAttachment based on a sprite. This method creates a real, usable AtlasRegion. That AtlasRegion uses a new AtlasPage with the Material provided.///

ToRegionAttachment ( this region, string attachmentName, float scale = 0.01f ) : RegionAttachment

Creates a new RegionAttachment from a given AtlasRegion.

ToRegionAttachmentPMAClone ( this sprite, Shader shader ) : RegionAttachment

Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate texture of the Sprite's texture data. Returns a RegionAttachment that uses it. Use this if you plan to use a premultiply alpha shader such as "Spine/Skeleton"

Method Details

GetRegion() public static method

Tries to get the region (image) of a renderable attachment. If the attachment is not renderable, it returns null.
public static GetRegion ( this attachment ) : AtlasRegion
attachment this
return AtlasRegion

SetPositionOffset() public static method

Sets the position offset. Call regionAttachment.UpdateOffset to apply the change.
public static SetPositionOffset ( this regionAttachment, Vector2 offset ) : void
regionAttachment this
offset UnityEngine.Vector2
return void

SetPositionOffset() public static method

Sets the position offset. Call regionAttachment.UpdateOffset to apply the change.
public static SetPositionOffset ( this regionAttachment, float x, float y ) : void
regionAttachment this
x float
y float
return void

SetRegion() public static method

Tries to set the region (image) of a renderable attachment. If the attachment is not renderable, nothing is applied.
public static SetRegion ( this attachment, AtlasRegion region, bool updateOffset = true ) : void
attachment this
region AtlasRegion
updateOffset bool
return void

SetRotation() public static method

Sets the rotation. Call regionAttachment.UpdateOffset to apply the change.
public static SetRotation ( this regionAttachment, float rotation ) : void
regionAttachment this
rotation float
return void

SetScale() public static method

Sets the scale. Call regionAttachment.UpdateOffset to apply the change.
public static SetScale ( this regionAttachment, Vector2 scale ) : void
regionAttachment this
scale UnityEngine.Vector2
return void

SetScale() public static method

Sets the scale. Call regionAttachment.UpdateOffset to apply the change.
public static SetScale ( this regionAttachment, float x, float y ) : void
regionAttachment this
x float
y float
return void

ToRegionAttachment() public static method

Creates a RegionAttachment based on a sprite. This method creates a real, usable AtlasRegion. That AtlasRegion uses the AtlasPage provided.///
public static ToRegionAttachment ( this sprite, AtlasPage page ) : RegionAttachment
sprite this
page AtlasPage
return RegionAttachment

ToRegionAttachment() public static method

Creates a RegionAttachment based on a sprite. This method creates a real, usable AtlasRegion. That AtlasRegion uses a new AtlasPage with the Material provided.///
public static ToRegionAttachment ( this sprite, Material material ) : RegionAttachment
sprite this
material UnityEngine.Material
return RegionAttachment

ToRegionAttachment() public static method

Creates a new RegionAttachment from a given AtlasRegion.
public static ToRegionAttachment ( this region, string attachmentName, float scale = 0.01f ) : RegionAttachment
region this
attachmentName string
scale float
return RegionAttachment

ToRegionAttachmentPMAClone() public static method

Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate texture of the Sprite's texture data. Returns a RegionAttachment that uses it. Use this if you plan to use a premultiply alpha shader such as "Spine/Skeleton"
public static ToRegionAttachmentPMAClone ( this sprite, Shader shader ) : RegionAttachment
sprite this
shader UnityEngine.Shader
return RegionAttachment