So I have this setup where i determine caret position from code since i use my own input field, i use just text field. So let me just explain problem
Canvas: 1902x1080
CMD container: has shell and input text
when you type, characters are added to input text,
because its horizontal layout items are from left to right
Caret posititon is determined by shell text positon (0,0) and then add shell.width text.width (of rect transform) to x position
I have other system of force update canvas and text generator and generating position by text vertices
both of these methods work fine so for example at 1920x1080 resolution:
Shell postion: 0, -25
Shell width: 208
Input position: 208, -25
Input width: 221
Caret position: 429, -36
This works perfectly fine with TextGenerator and width calculation method
but if i change resolution to same aspect like 1280x720 or different aspect 800x600, Everything is destroyed, i tried using canvas scaler to multiply or take base resolution and divide it by current but nothing works
Here are data for 800x600:
Shell position: 0, -25
Shell width: 199.5
Input position: 436.28, -25
Input width: 212
Caret position: -19.68
Okay i would understand that there is some big problem with my code if just the caret didnt work, but even input text position is wrong (shell cant be since it is at 0 position), shouldnt horizontal layout do the work?
I tried using my own calculator so each update game calculates position of shell text and size, then use that to position input at end of shell and get width for caret to use, but that messes up even 1920x1080 resolution
best that i got so far is using TextGenerator and then form those vertices using reference resolution/current resolution which is about 2.4 multiuplier for 800x600 but it is off for small amount which is good until about 20 chracters when gap is noticable
Any help?