cocoa - Remove Interpolation of CALayer's contents property -


re-asking question:

when add animation contents key, catransitionanimation apparently being triggered fades original contents property first value in animation's values array, resulting in .25 second fade. , looks bad! have suppressed every animatable property using methods discussed here (returning null animations through delegate, actions dictionary, using catransaction), none of these seem targeting particular transition animation.

alt text

i have been looking property possibly responsible this, cannot figure out.

i need suppress transition animation occurring when add animation contents key.

as i'm @ such loss, put keyframe animation being added see. figure maybe doing wrong here? note, array array of 6 cgimagerefs (the frames of animation).

+ (cakeyframeanimation *)moveleftanimation {  cakeyframeanimation *animation = [cakeyframeanimation animationwithkeypath:@"contents"]; animation.values = [nsarray arraywitharray:[setzer walkingleftsprite]]; animation.duration = 0.5f; animation.keytimes = [nsarray arraywithobjects:                       [nsnumber numberwithfloat:0.0],                        [nsnumber numberwithfloat:0.2],                        [nsnumber numberwithfloat:0.4],                       [nsnumber numberwithfloat:0.6],                       [nsnumber numberwithfloat:0.8],                       [nsnumber numberwithfloat:1.0],                       nil]; animation.timingfunction = [camediatimingfunction functionwithname:kcamediatimingfunctionlinear]; return animation; 

}

also, have animation handles position key, in sprite's action dictionary:

+ (cabasicanimation *)moveanimation {  cabasicanimation *moveanimation = [cabasicanimation animation]; moveanimation.timingfunction = [camediatimingfunction functionwithname:kcamediatimingfunctionlinear]; moveanimation.duration = 0.5f;  return moveanimation; 

}

i thinking maybe transition occurring when change layer's position? don't know...

please help! driving me nuts!

you can along lines of describe in this answer, disable implicit animations various layer properties setting appropriate values in actions dictionary on layer.

in case, believe like

nsmutabledictionary *newactions = [[nsmutabledictionary alloc] initwithobjectsandkeys:                                    [nsnull null], @"contents",                                    nil]; layer.actions = newactions; [newactions release]; 

should prevent implicit animation of layer's contents property until explicitly animate it.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -