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;