Cocoa Sprite Kit question
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.