# Positioning ropes equidistantly on a landscape display

I would like to render 4 similar ropes in my game that are equidistant on a landscape mode display.

How can I proceed? My screen is 1920*1080, at 420 dpi.

Is there any way that I could link the ropes coordinates with pixels or is there another way?

• What exactly do you mean by "equidistantly" here? – htmlcoderexe Apr 6 '20 at 14:36
• Unrelated comment - but good job on posting your queries as separate questions – Natalo77 Apr 6 '20 at 15:56

I think your screen size will likely vary between phones.

You should use a method to access the screensize.

Probably subtract a buffer (say 200 pixels) from each side of the screen size (e.g. 1920 - 2*200)

Divide the remainder by 5, as you want 4 ropes (so 5 gaps between them)

B = Buffer , G = Gap, | = Rope

B G | G | G | G | G B

Use a 'Screen Space to World Space' transformation to transform co-ordinates for the rope positions into world space coordinates at which they can be placed.

Rope n Position = BufferSize + n*GapSize

• Please can you detail how to transfor co ordinates into world space. I only know the x,y coordinate system that starts from the bottom left of the screen.Am I mistaken? – aqw Apr 6 '20 at 16:46
• I found a drawable.setBounds(x,y,a,b) wherd I can set the limits for my renderd image. Is it useful? – aqw Apr 6 '20 at 16:53
• I am not experienced in Java android studio - specific technical advice is something I can't give - I can only help you in terms of suggesting an approach that you might take, as I have done. – Natalo77 Apr 7 '20 at 8:56