如何獲取場景的邊界?SKScene:場景的邊界
我與演示測試,我以這種方式初始化一幕:
GameScene *scene = [GameScene unarchiveFromFile:@"GameScene"];
scene.scaleMode = SKSceneScaleModeAspectFill;
所以,當我在屏幕上點擊我登錄:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
for (UITouch *touch in touches) {
CGPoint location = [touch locationInNode: self];
NSLog(@"%f, %f", location.x, location.y);
}
}
當我按下左下角我得到大約300-0,而我期待0-0。
我怎樣才能得到上下左右邊界?我找不到像這樣的方法:
[scene getBounds]
Scene.frame打印:(0,0,1024,768)不相應!