本文整理汇总了C#中CocosSharp.CCSprite.AddAction方法的典型用法代码示例。如果您正苦于以下问题:C# CCSprite.AddAction方法的具体用法?C# CCSprite.AddAction怎么用?C# CCSprite.AddAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CocosSharp.CCSprite
的用法示例。
在下文中一共展示了CCSprite.AddAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEnter
public override void OnEnter()
{
//
// This test MUST be done in 'onEnter' and not on 'init'
// otherwise the paused action will be resumed at 'onEnter' time
//
base.OnEnter();
CCSize s = Layer.VisibleBoundsWorldspace.Size;
CCLabelTtf l = new CCLabelTtf("After 5 seconds grossini should move", "arial", 16);
AddChild(l);
l.Position = (new CCPoint(s.Width / 2, 245));
//
// Also, this test MUST be done, after [super onEnter]
//
CCSprite grossini = new CCSprite(s_pPathGrossini);
AddChild(grossini, 0, kTagGrossini);
grossini.Position = (new CCPoint(200, 200));
CCAction action = new CCMoveBy (1, new CCPoint(150, 0));
grossini.AddAction(action, true);
Schedule(unpause, 3);
}
示例2: OnEnter
public override void OnEnter() {
base.OnEnter();
if (Parent.Tag == Tags.Client) {
var blades = new CCSprite(Resources.BossCardinalBlades) {
IsAntialiased = false,
PositionX = Texture.PixelsWide/2,
PositionY = Texture.PixelsHigh/2,
};
AddChild(blades, -1);
blades.AddAction(new CCRepeatForever(new CCRotateBy(0.7f, -90)));
}
}
示例3: AddCardinalImage
private void AddCardinalImage(int p1, int p2) {
var tmp = new CCSprite(Resources.BossCardinal) {
Texture = {IsAntialiased = false},
PositionX = p1,
PositionY = p2,
Scale = 6
};
var blades = new CCSprite(Resources.BossCardinalBlades) {
Scale = 1,
IsAntialiased = false,
PositionX = tmp.Texture.PixelsWide/2,
PositionY = tmp.Texture.PixelsHigh/2
};
blades.AddAction(new CCRepeatForever(new CCRotateBy(0.7f, -120)));
tmp.AddChild(blades, -1);
if (tmp.PositionX > Settings.ScreenWidth/2) {
tmp.FlipX = true;
}
AddChild(tmp);
}