Games bc.BuildPatternCache not available anymore

Gunther

Active Member
Licensed User
Hello,

as you may see here in the screenshot the edges are very steppy althrough the original PNG of the green circle has a proper edge.

Any way to smoothen that edges?

The PNG is loaded via Tiled to the body with alias set to 1 degree. The yellow one behind is added by painting a bc and added to the Graphcache. And this is looking fine.

B4X:
    bc.Initialize(bmp.Width, bmp.Height)
    bc.CopyPixelsFromBitmap(bmp)
    bc.BuildPatternCache(IgnoreSemiTransparent) '  < ---- not available

upload_2019-1-21_16-50-14.png
 
Last edited:

Gunther

Active Member
Licensed User
Hi,

here is the TestProject.

One ball is rotating the other is fixed to compare. AntiAlias is enabled for both.

With "Q" you may change the background color. Try to get a bright one (yellow or so)
 

Attachments

  • TestProject.zip
    32.9 KB · Views: 145

Erel

Administrator
Staff member
Licensed User
The image is antialiased. This means that when you rotate it the semitransparent border is rotated as well and the result is not smooth. The semitransparent edge matches a specific layout which is not kept during rotation.

You will get better results with an image without antialiasing and with a lighter border. Though it will not be as sharp as drawing the circle yourself.
 

Gunther

Active Member
Licensed User
Thanks, you mentioned something like this already in the AngryBirds Example concerning the Hook but without the rotation impact.
 
Last edited:
Top