samedi 9 mai 2015

iOS issue moving sprite kit node SpriteKit

Hello i'm tring to get the position of a sprite kit node. If it doesn't move is't all right i got the exact position in int's view.

But if a start a move action on it

[self runAction:[SKAction repeatActionForever:
                 [SKAction moveByX:-1
                                 y:0
                          duration:0.004]] withKey:@"movingWave"];

the following code display the origin position of the sprit kit node and not the position that the object have related to the view

    SKNode *tmp = [self childNodeWithName:[NSString stringWithFormat:@"waves%d", numwaves]];
    CGPoint pos=[super convertPointFromView:tmp.position];
    NSLog(@"%f",pos.x);

/*terminal */

2015-05-09 20:34:58.620 Wave's attack[2349:607] -284.000000

2015-05-09 20:34:58.652 Wave's attack[2349:607] -284.000000

Aucun commentaire:

Enregistrer un commentaire