Fade In - Fade Out Efect?
You'll need to create a byte array of rgba values using Image.getRGB(), fade the RGB values, then create a new image from the byte array using Image.createRGBImage().
Google "midp fading" for examples.
That's midp2 only.
Google "midp fading" for examples.
That's midp2 only.
you need to do the same with the sprtie image, and manually reduce the RGB values in a loop each frame till they are gray...then use the new value as the sprite, you can only set a transparent in midp2 so its a limited use.
Its also a considerable processing task and not all handsets will have the power to handle it.
Its also a considerable processing task and not all handsets will have the power to handle it.
For sprites fading in and out during gameplay you might want to just use a bunch of frames that slowly fades out if memory permits. It will be a lot faster.
shmoove
shmoove
Like any other sprite animation. A bunch of frames that slowly fade out. This will mean that you need a lot more graphics, so you'll get a bigger jar and more heap usage, so it's a trade-off in that sense (which is why I said "if memory permits").
shmoove
shmoove
Depending on what you need to fade, you can simply paint a semitransparent image on top of the whole screen repeatedl and make it fade to that image.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement