Forum Xamarin.iOS

How to preload texture atlas in Xamarin.iOS ?

ThanhNgoThanhNgo USMember ✭✭

Hello everyone,

Would you please show me a small sample code written in C# within the Xamarin.iOS framework that would preload texture atlases ?

Xamarin website has this page:

https://developer.xamarin.com/api/type/MonoTouch.SpriteKit.SKTextureAtlas/

On that webpage, they list the many methods that preload the texture atlases. But, I am only interested in these 2 specific methods:

PreloadTextures(SKTextureAtlas[], NSAction)

PreloadTexturesAsync(SKTextureAtlas[])

I guess any of those 2 methods would probably work well for my game. Unfortunately, I don't know how to properly call them in C# within the Xamarin.iOS framework.

While there are many sample codes for preloading texture atlases on the web, these samples are written in Objective-C, and, unfortunately, I don't know how to translate Objective-C code to C# code yet.

So, I would greatly appreciate if you could show me how to write some small sample codes in C# within the Xamarin.iOS frame work that preload texture atlases.

Thank you very much.

Sign In or Register to comment.