Answer the question
In order to leave comments, you need to log in
How to calculate distance between objects with dynamic X and Y?
We have a screen, canvas or graphic, X (width) and Y (height), in pixels.
X and Y may change depending on the resolution of the device/screen/display.
For example:
X: ~1080 px
Y: ~218 px
You need to mark up 2 or n objects.
Let Y(obj) of each object be ~218 px, and X(obj) is unknown, but for example, you can take ~109 px.
Let's take d (distance) as the distance of objects from each other.
Purpose: The distance between objects should be the same despite different screens, canvases or graphics, i.e. X and Y screen, canvas or graphics may change. Those. we pass the same unit of distance and get the same distance between objects. Maybe someone has some ideas? I really need a formula.
Answer the question
In order to leave comments, you need to log in
The distance between objects must be the same
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question