"TheEndless" wrote:
"Greg47" wrote:
Does anybody have an example of using the roTextureRequest and Manager in the background? I have it setup to create loading bitmaps first of all the data, but having trouble figuring out how to kick off and let the real images fill in as they are ready. Thanks.
That's where being able to pull the bitmap directly from the roTextureRequest would come in really handy. Probably the best way to do it would be to share the message port, so you can listen for roTextureRequestEvents while you're listening for roUniversalControlEvents from your screen.
Yeah that was the approach I was thinking of and was doing too. Just sharing the same port between the two. I'm creating the dummy bitmaps first to draw out the layout quickly and then I'm trying to figure out how to replace the dummy ones as the images finish downloading. I can kick off the request perfectly fine doing something like:
function getItems(textureManager As Object) As Object
items = CreateObject("roArray", 25, true)
for i = 0 to 25
bitmap = CreateObject("roBitmap", {width: width, height: height, AlphaEnable: true})
bitmap.Clear( &h222835FF )
request = CreateObject("roTextureRequest", "external url")
textureManager.RequestTexture(request)
items.Push(bitmap)
end for
return items
end function
But then I'm struggling to figure out how to connect the requested bitmap back to the items array. I thought I could maybe get the request event id's and then connect that back to the item array index, but it does't seem that the event id is kicked off on every single item. It seems like it doesn't actually get the id until the async is complete. And maybe I'm trying to kick off the download in the wrong spot. Thanks for any help.