C# Class SKSprite, SpriteKit

Inheritance: MonoBehaviour
Mostra file Open project: prime31/SpriteKit Class Usage Examples

Public Properties

Property Type Description
anchor SpriteAnchor,
animations SKSpriteAnimationState>.Dictionary
currentAnimation SKSpriteAnimation,
desiredSize Vector2
isDoubleDensityScreen bool
meshFilter UnityEngine.MeshFilter
pixelPerfectHDSize Vector2
renderer Renderer
scale Vector3
sourceImageName string
spriteSheet SKSpriteSheet,
tintColor Color

Public Methods

Method Description
Awake ( ) : void
createSprite ( SKSpriteSheet, sheet, string imageName, SpriteAnchor, anchor ) : SKSprite,
createSprite ( string imageName, SpriteAnchor, anchor ) : SKSprite,
createSprite ( string sheetName, string imageName, SpriteAnchor, anchor ) : SKSprite,
faceBackwards ( ) : void
faceForwards ( ) : void
flipHorizontally ( ) : void
generateMesh ( ) : void
playAnimation ( string name ) : void
preloadAnimations ( ) : void
rotate ( float degrees ) : void
setColor ( Color tint ) : void
setUVs ( Rect uvRect ) : void
startAnimation ( string name ) : void

Protected Methods

Method Description
generateVerts ( Mesh &mesh ) : void
getUvsForClippedQuad ( Rect uvRect, float clippedWidth, float clippedHeight, Vector2 orthoAdjustedPixelPerfectHDSize ) : Vector2[]
offsetForAnchor ( ) : Vector2

returns the required offset for a given anchor assuming quads are built from the bottom left to top right

Private Methods

Method Description
OnApplicationQuit ( ) : void
Update ( ) : void

Method Details

Awake() public method

public Awake ( ) : void
return void

createSprite() public static method

public static createSprite ( SKSpriteSheet, sheet, string imageName, SpriteAnchor, anchor ) : SKSprite,
sheet SKSpriteSheet,
imageName string
anchor SpriteAnchor,
return SKSprite,

createSprite() public static method

public static createSprite ( string imageName, SpriteAnchor, anchor ) : SKSprite,
imageName string
anchor SpriteAnchor,
return SKSprite,

createSprite() public static method

public static createSprite ( string sheetName, string imageName, SpriteAnchor, anchor ) : SKSprite,
sheetName string
imageName string
anchor SpriteAnchor,
return SKSprite,

faceBackwards() public method

public faceBackwards ( ) : void
return void

faceForwards() public method

public faceForwards ( ) : void
return void

flipHorizontally() public method

public flipHorizontally ( ) : void
return void

generateMesh() public method

public generateMesh ( ) : void
return void

generateVerts() protected method

protected generateVerts ( Mesh &mesh ) : void
mesh Mesh
return void

getUvsForClippedQuad() protected method

protected getUvsForClippedQuad ( Rect uvRect, float clippedWidth, float clippedHeight, Vector2 orthoAdjustedPixelPerfectHDSize ) : Vector2[]
uvRect Rect
clippedWidth float
clippedHeight float
orthoAdjustedPixelPerfectHDSize Vector2
return Vector2[]

offsetForAnchor() protected method

returns the required offset for a given anchor assuming quads are built from the bottom left to top right
protected offsetForAnchor ( ) : Vector2
return Vector2

playAnimation() public method

public playAnimation ( string name ) : void
name string
return void

preloadAnimations() public method

public preloadAnimations ( ) : void
return void

rotate() public method

public rotate ( float degrees ) : void
degrees float
return void

setColor() public method

public setColor ( Color tint ) : void
tint Color
return void

setUVs() public method

public setUVs ( Rect uvRect ) : void
uvRect Rect
return void

startAnimation() public method

public startAnimation ( string name ) : void
name string
return void

Property Details

anchor public_oe property

public SpriteAnchor, anchor
return SpriteAnchor,

animations public_oe property

public Dictionary animations
return SKSpriteAnimationState>.Dictionary

currentAnimation public_oe property

public SKSpriteAnimation, currentAnimation
return SKSpriteAnimation,

desiredSize public_oe property

public Vector2 desiredSize
return Vector2

isDoubleDensityScreen public_oe static_oe property

public static bool isDoubleDensityScreen
return bool

meshFilter public_oe property

public MeshFilter,UnityEngine meshFilter
return UnityEngine.MeshFilter

pixelPerfectHDSize public_oe property

public Vector2 pixelPerfectHDSize
return Vector2

renderer public_oe property

public Renderer renderer
return Renderer

scale public_oe property

public Vector3 scale
return Vector3

sourceImageName public_oe property

public string sourceImageName
return string

spriteSheet public_oe property

public SKSpriteSheet, spriteSheet
return SKSpriteSheet,

tintColor public_oe property

public Color tintColor
return Color