我想知道是否有人可以請求幫助。基本上我在下面有一些目標C代碼,有誰知道我可以如何將它附加到Mac OS X的CAShapeLayer而不是iOS ?.如何將NSBezierPath附加到CAShapeLayer
****//// Color Declarations
NSColor* fillColor = [NSColor colorWithCalibratedRed: 0 green: 0.886 blue: 0.886 alpha: 1];
NSColor* strokeColor = [NSColor colorWithCalibratedRed: 0 green: 0 blue: 0 alpha: 1];
//// Star Drawing
NSBezierPath* starPath = [NSBezierPath bezierPath];
[starPath moveToPoint: NSMakePoint(106, 91.5)];
[starPath lineToPoint: NSMakePoint(110.21, 82.56)];
[starPath lineToPoint: NSMakePoint(119.18, 86.7)];
[starPath lineToPoint: NSMakePoint(116.65, 77.15)];
[starPath lineToPoint: NSMakePoint(126.19, 74.56)];
[starPath lineToPoint: NSMakePoint(118.11, 68.86)];
[starPath lineToPoint: NSMakePoint(123.75, 60.75)];
[starPath lineToPoint: NSMakePoint(113.91, 61.58)];
[starPath lineToPoint: NSMakePoint(113.01, 51.74)];
[starPath lineToPoint: NSMakePoint(106, 58.7)];
[starPath lineToPoint: NSMakePoint(98.99, 51.74)];
[starPath lineToPoint: NSMakePoint(98.09, 61.58)];
[starPath lineToPoint: NSMakePoint(88.25, 60.75)];
[starPath lineToPoint: NSMakePoint(93.89, 68.86)];
[starPath lineToPoint: NSMakePoint(85.81, 74.56)];
[starPath lineToPoint: NSMakePoint(95.35, 77.15)];
[starPath lineToPoint: NSMakePoint(92.82, 86.7)];
[starPath lineToPoint: NSMakePoint(101.79, 82.56)];
[starPath closePath];
[fillColor setFill];
[starPath fill];
[strokeColor setStroke];
[starPath setLineWidth: 1];
[starPath stroke];****
基本上,我使用的應用程序Paintcode並想創建形狀,然後將它們轉換爲將要用來製作動畫一個CAShapeLayer。
任何幫助將不勝感激。
問候。
我覺得這後會幫助http://stackoverflow.com/questions/15318918/how-to-make-my-uibezierpath-animated-with-cashapelayer – BigBadOwl
我認爲該鏈接僅適用於iOS,正如我以前所見,我需要一些代碼爲OS X.無論如何,謝謝。 – Nightowl