@SinisterSoft you can use TextureRegion:setRegion(...) and Bitmap:setTextureRegion(...) to display a region of a texture and you can change that region fast. @OzApps has a good example of this somewhere in the forum.
For those that might ask why have a single image rather than multiple smaller images (which are easier to work with from code) here is a lovely animation from Andreas Löwe of TexturePacker http://www.codeandweb.com/what-is-a-sprite-sheet
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
We've released a new version as 2012.09.4. With this version loading of 8-bit PCM .wav files is supported and there is no other change. If you're getting "Sound format is not supported" error, you can download the new version or convert your sounds to 16-bit.
After i upgraded to 2012.09.3, my app is constantly crashing at some point. Probably because of the Sound API, it looks like it happen when run out of channel (i checked whether it returns nil or not), after it return nil, simulator not responding. But i still don't know if it's the problem or not.
Switch back to .2012.09.2, and everything work fine.
@tkhnoman - For a fast test, I've limited the maximum number of channels to 3 and played many sound effects one after another. I can get nils but I couldn't crash the player. On which platform does this crashing happen?
Also can you upgrade to 2012.09.4? Maybe you have 8-bit sound files. (but it shouldn't crash no matter what)
Forget to say this, it only crash when playing music. Format is mp3. I still wonder if it's because of run out of channel, or something else. But it returns nil.
I will try to upgrade it. In the meantime, i will experimenting once again.
Also I couldn't crash the player for mp3 files (played multiple mp3 files simultaneously). Are you able to you isolate the problem to a simple test case and send me? If you can, that would be great while catching the problem.
@atilim - Thanks for updating so quickly. I've had some problems similar to @tkhnoman. Using 2012.09.3 my app would crash quite often, but only when I built it as an apk and used that on my device. It ran fine in Gideros player both on the PC and on the device. I rebuilt exactly the same app using 2012.09.2 and the apk is as solid as a rock on the device. I'll try the newer version later today and see what that does.
I'm really sorry, but the problem is not the Sound. I tried to disable it completely, and it still happen. Still don't know what it was, since what i just doing to test is switching between rounds, and not playing.
It still happen on 2012.09.4. I will stick with 2012.09.2...
What i can say right now is that it happen when i did collectgarbage(), but the crash might did't happen right away, it might happen on screen change sometime after that.
Things that happen in my testing is just event.ENTER_FRAME, event.COMPLETE(of a movie.clip) and some texture load and remove.
If i remove all collectgarbage() from the start of the round, it doesn't happen. But this message appear after testing for a while, and another simulator crash happen. (
Not tried 2012.09.4, but I call collectgarbage and all works fine here on 2012.09.03.
What would be handy is something to make sure the filename case is the same as the actual file (for the simulator and the loader) because when made into an apk if the case is incorrect then the file will not load. On the simulator and on the loader it does work however - a warning would be handy.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Comments
And I have a little bit better alternative to your solution:
Likes: SinisterSoft
Likes: atilim
and the same is also available on GitHub as an open source library to use for animation at http://ozapps.github.com/AnimationLib/
which can be extended/modified as your project might require.
For those that might ask why have a single image rather than multiple smaller images (which are easier to work with from code) here is a lovely animation from Andreas Löwe of TexturePacker http://www.codeandweb.com/what-is-a-sprite-sheet
Likes: SinisterSoft
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
https://deluxepixel.com
Just checking.reminding of couple things
How about Font Cache: http://www.giderosmobile.com/forum/discussion/2133/settext-perfomance-issue#Item_19
And how about this awesome suggestion from @Scouser?
http://www.giderosmobile.com/forum/discussion/comment/15140#Comment_15140
Thanks,
Marc
We've released a new version as 2012.09.4. With this version loading of 8-bit PCM .wav files is supported and there is no other change. If you're getting "Sound format is not supported" error, you can download the new version or convert your sounds to 16-bit.
@ar2rsawseen both issues are on my mind
(updated the title of this announcement)
Probably because of the Sound API, it looks like it happen when run out of channel (i checked whether it returns nil or not), after it return nil, simulator not responding.
But i still don't know if it's the problem or not.
Switch back to .2012.09.2, and everything work fine.
Also can you upgrade to 2012.09.4? Maybe you have 8-bit sound files. (but it shouldn't crash no matter what)
Forget to say this, it only crash when playing music. Format is mp3.
I still wonder if it's because of run out of channel, or something else. But it returns nil.
I will try to upgrade it.
In the meantime, i will experimenting once again.
:O :O :O
Still downloading the 2012.09.4.
I've had some problems similar to @tkhnoman. Using 2012.09.3 my app would crash quite often, but only when I built it as an apk and used that on my device. It ran fine in Gideros player both on the PC and on the device. I rebuilt exactly the same app using 2012.09.2 and the apk is as solid as a rock on the device. I'll try the newer version later today and see what that does.
event.x, event.y, event.touch.x and event.touch.y are still rounded and integer.
I will stick with 2012.09.2...
What i can say right now is that it happen when i did collectgarbage(), but the crash might did't happen right away, it might happen on screen change sometime after that.
Things that happen in my testing is just event.ENTER_FRAME, event.COMPLETE(of a movie.clip) and some texture load and remove.
If i remove all collectgarbage() from the start of the round, it doesn't happen.
But this message appear after testing for a while, and another simulator crash happen.
(
What would be handy is something to make sure the filename case is the same as the actual file (for the simulator and the loader) because when made into an apk if the case is incorrect then the file will not load. On the simulator and on the loader it does work however - a warning would be handy.
https://deluxepixel.com