Domanda

How would I do some sort of animation or transition between two C4Images?

I have a setup like this:

C4Image * img1 = [[C4Image alloc] initWithRawData:rawData width:width height:height];
C4Image * img2 = [[C4Image alloc] initWithRawData:rawData width:width height:height];

[self.canvas addImage:img1];
// insert magic here to trigger transition
[self.canvas addImage:img2];
È stato utile?

Soluzione

The easiest way to do a transition is:

image1.animationDuration = 1.0f;
image1.image = image2;

You can find a snippet here that crossfades an image to a new image 1 second after launching the app:

https://gist.github.com/C4Code/5074430

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top