本文整理汇总了C#中CocosSharp.CCEvent类的典型用法代码示例。如果您正苦于以下问题:C# CCEvent类的具体用法?C# CCEvent怎么用?C# CCEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CCEvent类属于CocosSharp命名空间,在下文中一共展示了CCEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTouchesEnded
void OnTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
{
if (touches.Count > 0)
{
}
}
示例2: OnTouchesEnded
void OnTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
{
if (touches.Count > 0)
{
// Perform touch handling here
}
}
示例3: onTouchMoved
void onTouchMoved(CCTouch touch, CCEvent touchEvent)
{
CCPoint touchLocation = touch.Location;
CCPoint nodePosition = ConvertToNodeSpace(touchLocation);
m_test.MouseMove(new Vector2(nodePosition.X, nodePosition.Y));
}
示例4: OnTouchesBegan
public void OnTouchesBegan(List<CCTouch> touches, CCEvent touchEvent)
{
CCTouch touch = touches.FirstOrDefault();
CCPoint location = touch.Location;
List<CCPhysicsShape> shapes = Scene.PhysicsWorld.GetShapes(location);
CCPhysicsBody body = null;
foreach (var obj in shapes)
{
if ((obj.Body.Tag & DRAG_BODYS_TAG) != 0)
{
body = obj.Body;
break;
}
}
if (body != null)
{
CCNode mouse = new CCNode();
mouse.PhysicsBody = new CCPhysicsBody();
mouse.PhysicsBody.IsDynamic = false;
mouse.Position = location;
AddChild(mouse);
CCPhysicsJointPin join = CCPhysicsJointPin.Construct(mouse.PhysicsBody, body, location);
join.SetMaxForce(5000 * body.GetMass());
Scene.PhysicsWorld.AddJoint(join);
mouses.Add(touch.Id, mouse);
}
}
示例5: OnTouchesEnded
public void OnTouchesEnded(List<CCTouch> touches, CCEvent e)
{
if (!win)
{
foreach (CCTouch touch in touches)
{
for (int i = 0; i < botones.Length; i++)
{
if (GameData.CheckIfSpriteTouched(touch, botones[i]))
{
if (llamando == i + 1 && jugadoresActivos[i])
{
debug.Text = "Correcto!";
debug.Color = GetColorJugador(i + 1);
contesto = true;
CCSimpleAudioEngine.SharedEngine.PlayEffect("sounds/coin");
}
else
{
DerrotaJugador(i + 1);
}
}
}
}
}
else {
ReturnToMenu();
}
}
示例6: onTouchesEnded
void onTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
{
//base.ccTouchesEnded(touches, event_);
object it = touches.First();
CCTouch touch = (CCTouch)(it);
var convertedLocation = touch.Location;
CCNode s = this[ClickAndMoveTest.kTagSprite];
s.StopAllActions();
s.RunAction(new CCMoveTo (1, new CCPoint(convertedLocation.X, convertedLocation.Y)));
float o = convertedLocation.X - s.Position.X;
float a = convertedLocation.Y - s.Position.Y;
float at = (float)(Math.Atan(o / a) * 57.29577951f);
if (a < 0)
{
if (o < 0)
at = 180 + Math.Abs(at);
else
at = 180 - Math.Abs(at);
}
s.RunAction(new CCRotateTo (1, at));
}
示例7: OnTouchEnded
void OnTouchEnded(CCTouch touch, CCEvent touchEvent)
{
bool hits = touchHits(touch);
if (hits && Triggered != null)
Triggered(this, EventArgs.Empty);
scaleButtonTo(1);
}
示例8: HandleTouchesMoved
void HandleTouchesMoved(System.Collections.Generic.List<CCTouch> touches, CCEvent touchEvent)
{
// we only care about the first touch:
var locationOnScreen = touches [0].Location;
paddleSprite.PositionX = locationOnScreen.X;
}
示例9: onTouchesEnded
void onTouchesEnded(List<CCTouch> pTouches, CCEvent touchEvent)
{
drag = false;
snapArrowsToEdge();
arrowsBar.Visible = false;
UpdateLineHeight();
}
示例10: OnTouchBegan
bool OnTouchBegan(CCTouch touch, CCEvent touchEvent)
{
bool hits = touchHits(touch);
if (hits)
scaleButtonTo(0.9f);
return hits;
}
示例11: HandleTouchesEnded
private void HandleTouchesEnded(System.Collections.Generic.List<CCTouch> touches, CCEvent touchEvent)
{
foreach (CCTouch Touch in touches) {
if (startGame != null) {
startGame ();
}
}
}
示例12: onTouchBegan
bool onTouchBegan(CCTouch touch, CCEvent touchEvent)
{
if (m_state != PaddleState.kPaddleStateUngrabbed) return false;
if (!containsTouchLocation(touch)) return false;
m_state = PaddleState.kPaddleStateGrabbed;
return true;
}
示例13: OnTouchesEnded
public void OnTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
{
foreach (CCTouch touch in touches) {
if (touch == Touch) {
Touch = null;
return;
}
}
}
示例14: onTouchesMoved
void onTouchesMoved(List<CCTouch> touches, CCEvent touchEvent)
{
var diff = touches[0].Delta;
var node = GetChildByTag((int)KTag.kTagNode);
var currentPos = node.Position;
node.Position = currentPos + diff;
}
示例15: OnTouchesEnded
/// <summary>
/// If the touch is ended return the visbility of this layer and reverse it.
/// </summary>
/// <returns><c>true</c> if this layer is visible; otherwise, <c>false</c>.</returns>
/// <param name="touches">The touches list.</param>
/// <param name="touchEvent">The touch event.</param>
public bool OnTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
{
if (Visible)
{
Visible = !Visible;
return true;
}
return false;
}