This has been some confusion as to what I am asking on both sides (As I wasn't clear or completely sure myself). I'm having a problem formulating the word problem (Not solving it) of how this:
can help me normalize this:
So that I can have a one, scaling solution across multiple resolutions (and platforms) like these:
For instance, I suppose I could use PPI (Pixels Per Inch often known as Dots per inch - DPI) to calculate the physical size of the screen and download an appropriate resolution set of UI(assume we have a server with many resolution sets of User Interface available for download) specific to that size (Again, how does PPI even relate the resolution to physical screen size?)
This current problem is where does PPI (Screen.dpi) fit into calculating a normalized swipe delta change across multiple size screens?
Please let me know if I can be any more clear, because "divide/multiply as necessarily" is not helping me determine the relationship between PPI and normalizing swipe distance.
Note: these images were pulled from random google searches of:
So building off of my first question, Delta Position is different for every Android phone type. Is there a good way to go about correcting it between phones with an algorithm? Our director doesn't want to put something inside the game to change the sensitivity because most of our target audience (teachers) wouldn't even bother this.
Ok, so I guess its time to revamp the question. Jessy pointed out that Screen.dpi would help with the correction, but how would .dpi be used in an algorithm to scale uniformly across multiple dpi's? I don't even know where to begin with constructing a formula to achieve this.
Why am I dividing the vertical delta position? I have no idea. So what would be a correct way to use Screen.dpi so that it would scale across android devices(and ideally to ios devices as well)?
DPI is irrelevant. The key is
You can account for this as follows:
So, the code for dragging a scrollview would be:
(note that the conversion to/from Screen/GUI point is just to get Y going in the right direction, but it will also let you modify GUI.matrix, which can be quite useful on mobile).
No need to multiply anything by DPI. No need for magic "multiply by 3" that I have also seen others recommending.
DPI is irrelevant to touch delta position since while it is true that at higher DPI you need to move objects by more pixels, the user's finger travels proportionally more pixels too, resulting in a larger deltaPosition and cancelling out any need to consider DPI/PPI.
The second P is "per".
The ratio of inches to pixels is (1 inch / Screen.dpi pixels).
So, the physical width of the screen is (Screen.width pixels * (1 inch / Screen.dpi pixels)).
I'll cancel out terms for the height result: (Screen.height / Screen.dpi) inches.
Touch.deltaPosition is also measured in pixels.
Multiply or divide as necessary to achieve the desired result.