Xamarin Sprite Animation Within a Sub-View
I am attempting to use Xamarin, not MonoGame, to render a sprite. I want to describe my situation in its entirety to help give my question some background. I want to use a UIViewController to display two UIView(s) on the Window. One UIView, UIView A, will be positioned directly above the second, UIView B, on the screen, rather than overlaying it. The UIView B will force an event that will render a sprite on UIView A. At the moment I have this event being caught by the UIViewController and the Controller throws the Event into UIView A. I am left without the knowledge of how to render the sprite in the UIView A. I’ve done a good amount of research and come up with a few solutions, none of which I have been able to get working successfuly. I will list the solutions I have found. I placed them in order of which I would prefer to try.
Solution #1: GLKView I found that many people have issues with animation lag using CoreAnimation. In Objective-C, on iOS, the recommendation is to use GLKView. I can’t find how this would work in Xamarin. I have found Objective-C examples, none very detailed, of how to launch a GLKView in a UIViewController. None explicitly say how to set up the Delegate Function to handle the screen draw. This also does not explain how to handle pulling images from a sprite sheet.
Solution #2: Cocos2D I found that many 2D games for iOS are built using Cocos2D due to its ability to render sprites easily. I found that in Objective-C, on iOS, you can load a UIView that is a Cocos2D View. I know people have built Cocos2D games using Xamarin. However, I have yet to find a solid example of how to do this in Xamarin.
Solution #3: UIImageView I have found examples of how to accomplish simple sprite animations using UIImageView, located here: http://docs.xamarin.com/recipes/ios/standard_controls/image_view/animate_an_imageview. However the example loads multiple unique images and not images being pulled from a single sprite sheet. I attempted to find an Objective-C example and all examples using a GCImageRef Class that does not exist in Xamarin. The example is located here: How to cut a large sprite png into smaller UIImages?.
I’m sure other solutions may exist that I have yet to find, but I would like some input and examples on what solution I should take.
Thanks, Robert