I have this code: in a loop I draw circles while changing the distance between them. Next to it I have a reference line from 0 to 75%y. On the 10" emulator, the circles reach roughly 50% of the reference line, on the 4" emulator they are beyond the end of the line.
How to make it so that they reach the same % reference line regardless of the device?
How to make it so that they reach the same % reference line regardless of the device?
B4X:
Private Sub Button2_Click
Dim x, vx As Float
canvas.DrawLine(0, 300dip, 75%x, 300dip, Colors.Blue, 5dip) 'reference line
x = 0dip
vx = 17dip 'initial step
For i = 1 To 50
vx = vx * 0.95 'shortening the step
x = x + vx
canvas.Drawcircle(x, 310dip, 5dip , Colors.Green, True, 0)
Activity.Invalidate
Next
End Sub