LoginSignup
3
3

More than 5 years have passed since last update.

SpriteKit入門 -20-

Posted at

SKShapeNodeクラスを使用して図形を描画してみます。

HelloScene.m
- (void)createSceneContents
{
    self.backgroundColor = [SKColor blackColor];
    self.scaleMode = SKSceneScaleModeAspectFit;
    SKShapeNode *ball = [[SKShapeNode alloc] init];
    CGMutablePathRef myPath = CGPathCreateMutable();
    CGPathAddArc(myPath, NULL, 300, 300, 15, 0, M_PI*2, YES);
    ball.path = myPath;
    ball.lineWidth = 1.0;
    ball.fillColor = [SKColor blueColor];
    ball.strokeColor = [SKColor whiteColor];
    ball.glowWidth = 0.5;
    [self addChild:ball];
}

spritekit_20_01.png

今回はここまで。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3