ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Help/Support (https://www.esoui.com/forums/forumdisplay.php?f=164)
-   -   Texture size Versus Resolution size (https://www.esoui.com/forums/showthread.php?t=8552)

xTG 05/26/19 11:38 AM

Texture size Versus Resolution size
 
Hello,

I am looking to how customize the size of a texture relating of the resolution of the user.
Is it possible ?

Actually i generate a texture with a static size, but i will need to cover with multiples textures the HUD.

Code:

            <Controls>
              <Texture name="xTG_SearchIcon" textureFile="xTG_ImmersiveInterface/blood_2.dds" alpha="1">
                  <Dimensions x="600" y="600" />
                  <Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="0" offsetY="3" />
                  <TextureCoords left="0" right="1" top="0" bottom="1" />
              </Texture>
            </Controls>

Here i apply a texture of 600x600 on top left, but 600x600 is not great if the user play in 1024x768.
Any ideas ?

Shinni 05/26/19 11:59 AM

A texture of size 600x600 will look roughly the same, no matter what resolution the player will play in.
If the game runs in a higher resolution, then it automatically scales-up the entire UI. If it runs in a small resolution, the UI is downscaled.
The only difference comes from different aspect ratios, in which case there is some extra space available on screen.

https://wiki.esoui.com/AddOn_Quick_Q...pact_the_UI.3F

If you have a texture control of size 1680 x 1050, then it will always cover the entire vertical space or the entire horizontal space of the game window.

xTG 05/26/19 01:05 PM

Very interesting !
Thanks for the great link and the explanation. :)

xTG 05/27/19 01:33 PM

Seems strange in fact...
The wiki said the unit is : 1680 x 1050

But if i place a texture at x=1680 with 600 in x dimension i can see 1/3 of the texture...
And my screen resolution is 1980 width.

I tried with a box texture to understand... And it's clear that unit is pixel.
Am i missing something ?

ZOS_ChipHilseberg 05/28/19 08:00 AM

The UI size is at minimum 1920 x 1080.

xTG 05/28/19 10:15 AM

Thanks for the replie ChipHilseberg.

Does it mean if a player have a resolution of 2515 × 1886, i only need to set a texture of 1920 width and i will cover his screen ?

ZOS_ChipHilseberg 05/29/19 08:32 AM

It depends on the aspect ratio.

The aspect ratio is the screen width divided by the screen height. For 1920x1080 this is 1.777. If the aspect ration of your screen is less than that, there will be extra space on the top and bottom, so to fill the screen you would need to make it as tall as GuiRoot and as wide as that height times your aspect ratio. If the aspect ratio of your screen is greater than that, there will be extra space on the left and right, so to fill the screen you would make it as wide as GuiRoot and as tall as the width time 1/aspect ratio. This assumes you want to keep the same proportion of your texture. If not, just anchor it to the TOPLEFT and BOTTOMRIGHT of GuiRoot.


All times are GMT -6. The time now is 03:51 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI