Other [SOLVED] [XUI2D] Walking Character resolution

LucaMs

Expert
Licensed User
Longtime User
In the B4J version the birds look good. In the B4A version they lose a lot of quality. This is due to the too large size of the sprites, for smartphones. I decreased them up to 23% and this is the difference:
1638620172494.png

The image below (both from my smartphone) is after the reduction to 23%, of course.


Also, there is a horizontal black line, approximately 2/3 of the height of the screen. I think it is the border of the command rectangle, whose color should be set to Transparent.
 

LucaMs

Expert
Licensed User
Longtime User
Loading the original, large, not reduced to 23% image file into a small ImageView, the quality is very good.

1638621741054.png


So in XUI2D, what does that loss of quality depend on? BitmapCreator?

EDIT: I don't know XUI2D. I don't think it's BC; most likely:
B4X:
Private Sub CreateBird
'
'
    Dim wrapper As X2BodyWrapper = TileMap.CreateObject(template)
'
'
End sub
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is related to a performance optimization that is less relevant nowadays.

You can "disable" it with this code:
B4X:
ImageView1.Width = ImageView1.Width * xui.Scale
ImageView1.Height = ImageView1.Height * xui.Scale
X2.Initialize(Me, ImageView1, world) '<--- this is the original line in Game.Initialize
ImageView1.Width = ImageView1.Width / xui.Scale
ImageView1.Height = ImageView1.Height / xui.Scale
 
Upvote 0
Top