• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Cocoa Sprite Kit question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa Sprite Kit question


  • Subject: Cocoa Sprite Kit question
  • From: Alex Rice <email@hidden>
  • Date: Sun, 8 Sep 2002 22:26:18 -0600

Hi, any CSK users out there? I'm not sure if this is a bug, or I just don't understand Cocoa graphics that well yet. This code is using Cocoa sprite kit 1.0b2, and is supposed to create a big fat blue circular sprite in the center of the world, but instead I get a big fat blue circle with it's edges cropped in a rectangular pattern by half of the lineWidth.

SKBezierPathSprite *dialSprite;
NSBezierPath *dialPath = [NSBezierPath bezierPath];
NSRect bounds = [CocoaSpriteKit worldBounds];
bounds.size.height *= 0.8;
bounds.size.width = bounds.size.height;
[dialPath setLineWidth:bounds.size.width * 0.05];
[dialPath appendBezierPathWithOvalInRect:bounds];
dialSprite = [[SKBezierPathSprite alloc] initWithBezierPath:dialPath];
[dialSprite setStrokeColor:[NSColor blueColor]];
[dialSprite setShouldStrokePath:YES];
[dialSprite setXLocation:[CocoaSpriteKit worldBounds].size.width/2.0
YLocation:[CocoaSpriteKit worldBounds].size.height/2.0];
[layer addSprite:dialSprite];

Alex Rice
Mindlube Software
http://mindlube.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Passing autoreleased objects in Distributed Object calls?
  • Next by Date: Re[3]: gdb mycommand -withargsformycommand
  • Previous by thread: Passing autoreleased objects in Distributed Object calls?
  • Next by thread: [NEWBIE] When changing a view's size...
  • Index(es):
    • Date
    • Thread