I have a roScreen with a bunch of images flying around. I would like to download new images and replace the current ones on an individual basis with a staggered timer.
AsyncGettoFile works fine to download the images without disrupting the motion, but creating the new bitmaps causes the motion to pause for several frames. Anyway to create the bitmaps in the “background” as it were?
Thanks.
Check out the roTextureManager: http://sdkdocs.roku.com/display/sdkdoc/roTextureManager
Will do, Thanks Endless.
Am now using the texturemanager. I’m still getting a few frames pause when the bitmap is created. Before using the texmanager it was maybe 10 frames (60fps). Now its say 6 frames. To be sure I’m doing everything, i want to SetAsync on the request but have tried every way i can think of as to how & where. The docs say Async is the default, so i shouldn’t have to do this but i want to make sure before asking why its not creating the bitmap asynchronously like it is supposed to. Can some one point out how and where SetAsync(async as Boolean) as Integer fits in the code below, thank you.
texmgr.UnloadBitmap("tmp:/z"+photolist[0].GetName())
requestbm0 = CreateObject("roTextureRequest" , "tmp:/z"+photolist[10].GetName())
texmgr.RequestTexture(requestbm0)
msg=wait(0, texport)
if type(msg)="roTextureRequestEvent" then
if msg.GetState() = 3
bm0 = msg.GetBitmap()
end if
end if
Your code is blocking until you get an roTextureRequestEvent with a state of 3, so even though the request is asynchronous, your code is waiting for it to finish, which defeats the purpose.
As usual you are correct. Got rid of the wait and no hiccups!
Thanks again
