The texturemanager provides the asynchronous services that you need. This has nothing to do with sprites, regions, or compositors. However, you should understand that asynchronous retrieval is far more complex than waiting for all your bitmaps to arrive (synchronous). You should avoid synchronous requests for your grid. This is true even for preloading. Preloading should be done by asynchronous request sets and then polling for their return. Preloading is generally done prior to your grid showing. From then on it is realtime requesting, cancelling or unloading of textures as the user nagivagtes the grid. Threre are two primary problems that need to be solved in order to do this: The textures are requested asynchronously without waiting for them to return. This means the texturequest must stay in scope until completed; You have only a single thread to work with ( no worker threads ). This means that you have to check the texture queue ( I recommend a dedicated port ) In just about everything you do from then on, especially your scrolling and easing functions. It is important to quickly process the returned requests so that the queue is emptied and state of the requests are know and kept current as the user scrolls.
To do this you need to create a system that identifies each texture. This generally means an object that contains everything you need to draw to your grid. For example ( Im just typing this in quickly wthout really checking it but the concept is:
Function NewTextureObject() As Object
return {
TRequest: Invalid
Bitmap: Invalid
GridX: Invalid
GridY: Invalid
}
End Function
You would create one of these objects for each texture that you need to request. While the texture object can be reused, the TRequest cannot. So you need to create a new TRequest each time you request or re-request a texture. You would keep an array of these texture objects as a member of your grid object to insure persistence
This example will exaplain more. It's an old example improvements have been made but the idea is the same
http://forums.roku.com/viewtopic.php?f=34&t=70983#p446193This will give you a general idea of how the manager works
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )