I have already tried looking around and cannot seem to find any info on this topic for exactly what I am looking for.
If you are familiar with Unity3D uGUI, I am trying to achieve the same "Filled" type Image effect there but inside of XCode using Objective-C.
If I have a faded image of a "character" and then as time goes on, I want to fill that "character" image with a "filled character" image in the same position. How can I work through this?
I have tried using MGImageResizingUtilities but this seems to change the size of the image being that the cropped image is no longer the same size of the original image being used and scale is set to Aspect Ratio.
It was hard to find a good example but here is something to get an understanding. http://s22.postimg.org/9qghxosox/Screen_Shot_2016_01_30_at_17_08_06.png
Here is some code I am trying to use:
CALayer *maskLayer = [CALayer layer];
UIImage *maskImage = [UIImage imageNamed:@"turtle_posing"];
maskLayer.contents = (id)maskImage.CGImage;
maskLayer.bounds = self.filledTurtlePic.bounds;
CGRect turtleRect = self.filledTurtlePic.frame;
maskLayer.frame = CGRectMake(0, turtleRect.size.height, turtleRect.size.width, -turtleRect.size.height);
self.filledTurtlePic.layer.mask = maskLayer;
Here are two screenshots of an attempt to completely fill the image with the code above, and one screenshot with an attempt to partially fill the image (masklayer frame height is set to -40)
Thanks in advanced