Live wallpaper questions

f4u5t

Member
Licensed User
Longtime User
Hey everyone,
I have been playing around with live wallpapers, while learning B4A and I'll admit that I'm pretty new to this but I have been playing with one of the lwp demo's, the bouncing smiley one - and I have a few questions.
In my sample, I have modified the bouncing smiley, so that now it displays a falling snowflake.
1. there is a stutter in the display every time the screen is touched, I dont understand why
2. Is there a way to produce a real transparent background on the images, as the snowflakes pile up at the bottom you can see edges of bg color that should be transparent.
3. I would like to make the snowflakes that have fallen shift around on orientation change, right now I realize these are not objects, only artifacts that have not been cleared - how would that be handled?
 

Attachments

  • SnowLWP.zip
    60.3 KB · Views: 203

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Have you removed lwm_Touch event?
2. Transparent should be kept.
I've just ran the following test:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim c As Canvas
   c.Initialize(Activity)
   Dim bmp As Bitmap = LoadBitmap(File.DirAssets, "smiley.gif")
   Dim r As Rect
   r.Initialize(10dip, 10dip, 10dip + bmp.Width, 10dip + bmp.Height)
   c.DrawBitmap(bmp, Null, r)
   r.Initialize(20dip, 20dip, 20dip + bmp.Width, 20dip + bmp.Height)
   c.DrawBitmap(bmp, Null, r)
End Sub
SS-2012-12-11_10.21.02.png


3. You will need to implement the logic by saving the position of each flake and then reposition it as needed.
 
Upvote 0
Top