C# Class UISprite, DsynBio

Inheritance: UIWidget
Show file Open project: CyberCRI/DsynBio Class Usage Examples

Protected Properties

Property Type Description
mInner Rect
mInnerUV Rect
mOuter Rect
mOuterUV Rect
mScale Vector3
mSprite UIAtlas.Sprite

Public Methods

Method Description
GetAtlasSprite ( ) : UIAtlas.Sprite,

Retrieve the atlas sprite referenced by the spriteName field.

MakePixelPerfect ( ) : void

Adjust the scale of the widget to make it pixel-perfect.

OnFill ( BetterList verts, BetterList uvs, BetterList cols ) : void

Virtual function called by the UIScreen that fills the buffers.

OnUpdate ( ) : bool

Update the UV coordinates.

UpdateUVs ( bool force ) : void

Update the texture UVs used by the widget.

Protected Methods

Method Description
FilledFill ( BetterList verts, BetterList uvs, BetterList cols ) : void

Filled sprite fill function.

OnStart ( ) : void

Set the atlas and the sprite.

Rotate ( Vector2 v, int offset ) : void

Helper function that copies the contents of the array, rotated by the specified offset.

SetAtlasSprite ( UIAtlas sp ) : void

Set the atlas sprite directly.

SimpleFill ( BetterList verts, BetterList uvs, BetterList cols ) : void

Regular sprite fill function is quite simple.

SlicedFill ( BetterList verts, BetterList uvs, BetterList cols ) : void

Sliced sprite fill function is more complicated as it generates 9 quads instead of 1.

TiledFill ( BetterList verts, BetterList uvs, BetterList cols ) : void

Tiled sprite fill function.

Private Methods

Method Description
AdjustRadial ( Vector2 xy, Vector2 uv, float fill, bool invert ) : bool

Adjust the specified quad, making it be radially filled instead.

Method Details

FilledFill() protected method

Filled sprite fill function.
protected FilledFill ( BetterList verts, BetterList uvs, BetterList cols ) : void
verts BetterList
uvs BetterList
cols BetterList
return void

GetAtlasSprite() public method

Retrieve the atlas sprite referenced by the spriteName field.
public GetAtlasSprite ( ) : UIAtlas.Sprite,
return UIAtlas.Sprite,

MakePixelPerfect() public method

Adjust the scale of the widget to make it pixel-perfect.
public MakePixelPerfect ( ) : void
return void

OnFill() public method

Virtual function called by the UIScreen that fills the buffers.
public OnFill ( BetterList verts, BetterList uvs, BetterList cols ) : void
verts BetterList
uvs BetterList
cols BetterList
return void

OnStart() protected method

Set the atlas and the sprite.
protected OnStart ( ) : void
return void

OnUpdate() public method

Update the UV coordinates.
public OnUpdate ( ) : bool
return bool

Rotate() protected method

Helper function that copies the contents of the array, rotated by the specified offset.
protected Rotate ( Vector2 v, int offset ) : void
v Vector2
offset int
return void

SetAtlasSprite() protected method

Set the atlas sprite directly.
protected SetAtlasSprite ( UIAtlas sp ) : void
sp UIAtlas
return void

SimpleFill() protected method

Regular sprite fill function is quite simple.
protected SimpleFill ( BetterList verts, BetterList uvs, BetterList cols ) : void
verts BetterList
uvs BetterList
cols BetterList
return void

SlicedFill() protected method

Sliced sprite fill function is more complicated as it generates 9 quads instead of 1.
protected SlicedFill ( BetterList verts, BetterList uvs, BetterList cols ) : void
verts BetterList
uvs BetterList
cols BetterList
return void

TiledFill() protected method

Tiled sprite fill function.
protected TiledFill ( BetterList verts, BetterList uvs, BetterList cols ) : void
verts BetterList
uvs BetterList
cols BetterList
return void

UpdateUVs() public method

Update the texture UVs used by the widget.
public UpdateUVs ( bool force ) : void
force bool
return void

Property Details

mInner protected property

protected Rect mInner
return Rect

mInnerUV protected property

protected Rect mInnerUV
return Rect

mOuter protected property

protected Rect mOuter
return Rect

mOuterUV protected property

protected Rect mOuterUV
return Rect

mScale protected property

protected Vector3 mScale
return Vector3

mSprite protected property

protected UIAtlas.Sprite mSprite
return UIAtlas.Sprite