How to make a CALayer dont get blur when rotating.
How to make a CALayer dont get blur when rotating.
- Subject: How to make a CALayer dont get blur when rotating.
- From: Gustavo Pizano <email@hidden>
- Date: Sat, 13 Dec 2008 19:49:28 +0100
Hello well finally I manage to rotate the CALayer each time I click on
it. what I did was the following:
-(void)mouseDown:(NSEvent *)event
{
[event retain];
[mouseDownEvent release];
mouseDownEvent = event;
NSPoint p2 = [event locationInWindow];
NSPoint p3 = [self convertPoint:p2 fromView:nil];
CGPoint p = NSPointToCGPoint(p3);
CALayer * nLayer = [_gameboardLayer hitTest:p];
if (nLayer.name != nil) {
NSNumber* value = [NSNumber numberWithFloat:PERP()];
value = [NSNumber numberWithFloat:[value floatValue] + [[nLayer
valueForKeyPath:@"transform.rotation.z"] floatValue]];
[nLayer setValue:value forKeyPath:@"transform.rotation.z"];
}
}
#define PERP () (90 * M_PI / 180)
but I realize that each time the images its perpendicular its kinda
blurry I dunno how to rotate the layer without loosing quality.
the contents of the layer its .png
Thanks
Gus
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden