Sprite 有三種:OTFilledSprite,OTSprite,OTAnimatingSprite
最常用的可能是AnimatingSprite -_- 這跟cocos2d可能有些不同。
先說說Sprite,OTSprite : OTObject 前面幾個屬性一看就懂了吧,Pivot是中心點位置,Register Input是接收鼠標響應時間,Depth是影響深度(與cocos2d不同的是它不會自動排列,就是說如果你的兩個物體在同一深度又剛好重疊的話,你會發現各種不可預知的畫面出現-,-),Collidable是碰撞器,下面幾個是碰撞器相關,Draggable是可以拖動,Draggable設置爲true時Register Input也會設置成true,world bounds是世界座標限定,Flip
相關的是像素的倒置,Transparent是透明必定要勾上的,
Additive : Boolean (一般不用勾)
Checking this setting will set the material reference to 'additive' ( only works when transparent setting is also checked ). When transparent and additive are checked off, material reference will be set to 'solid'.
Material Reference 最重要的:材質在這裏設置,而不是在下面設置
Tint Color 只有材質是Tint 時纔可以使用
Alpha 透明度 1不透明
Image 和 Sprite Container 可以選其中一樣來添加
Animation Frameset: String
Set this to the name of a specific frameset from the linked animation that you want to play. If no animation frameset is specified, the combined framesets of the animation object will be played.
Speed:速度因子,1是正常速度,2是雙倍,0.5是半速
Looping 是否循環
Number Of Plays 播放多少次,-1是無限次
Play On Start 一開始就動畫
Start At Random Frame 隨機一幀開始
Destroy When Finished 播放完自動刪除
Animation Preview 預覽進度,只在編輯器中有效
下面是默認的sprite的設置:
OTSprite : OTObject
{
public bool _transparent = true;
public bool _additive = false;
public string _materialReference = "transparent";
public Color _tintColor = Color.white;
public float _alpha = 1.0f;
public int _frameIndex = 0;
public class OTAnimatingSprite : OTSprite
{
public OTAnimation _animation;
public string _animationFrameset = "";
public float _speed = 1;
public bool _looping = true;
public int _numberOfPlays = -1;
public bool _playOnStart = true;
public bool _startAtRandomFrame = false;
public bool _destroyWhenFinished = false;