Is there any way to support HIDPI?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Is there any way to support HIDPI?

Postby mintogo » Tue Jan 02, 2018 09:49

Hello, first of all, I'm very poor at English... forgive me..

Anyway... when create UI from Ceed(*.looknfeel, *.layout .. etc).

How can I support or detect HDPI Monitor?

because layout file is based on xml and pixel value, all components will be looks very small in hidpi monitor.

For example, My Notebook Dell XPS has 15 inch monitor and 4K resolution.

it's very high dpi, right?

and then if I create some layout using by CEED.

Its looks very very small.. in my notebook intergrated monitor.

On previous project, I used QML to create UI and I could calculate monitor scale from functions that QML supports.

is there any way in cegui?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Is there any way to support HIDPI?

Postby Ident » Tue Jan 02, 2018 18:08

Use relative scaling for the elements in your layout and for the imagesets and fonts you can also use scaling based on a native resolution. For high DPI you could increase the native resolution of your fonts and imagesets in runtime.

There is no better support for changing DPI currently. Also be aware that if imagery changes this will evidently also affect margins and padding for things like text, so you would have to consider that in your layouts.
CrazyEddie: "I don't like GUIs"

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: Is there any way to support HIDPI?

Postby mintogo » Wed Jan 03, 2018 00:18

Ident wrote:Use relative scaling for the elements in your layout and for the imagesets and fonts you can also use scaling based on a native resolution. For high DPI you could increase the native resolution of your fonts and imagesets in runtime.

There is no better support for changing DPI currently. Also be aware that if imagery changes this will evidently also affect margins and padding for things like text, so you would have to consider that in your layouts.


Thx for reply.

I should check I understood correctly or not.

If appling relative scaling, Is the size of the components(Buttons, Images.. etc) different for each resolution?

I want to showing same size of components for all resolution, just different distance between each component.

Did I misunderstand what you said?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Is there any way to support HIDPI?

Postby Ident » Wed Jan 03, 2018 07:09

mintogo wrote:
Ident wrote:I want to showing same size of components for all resolution, just different distance between each component.


Same relative size or same absolute size?
If you keep the absolute sizes then everything will be tiny.
CrazyEddie: "I don't like GUIs"

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: Is there any way to support HIDPI?

Postby mintogo » Wed Jan 03, 2018 08:00

Ident wrote:
mintogo wrote:
Ident wrote:I want to showing same size of components for all resolution, just different distance between each component.


Same relative size or same absolute size?
If you keep the absolute sizes then everything will be tiny.


Oh sorry I think didn't explain it exactly.

Not on resolution, about PPI(DPI).

Yeap If I keep absolute size, everything will be tiny, so on over 96 ppi monitor,

I need to upscale everything.

For example, if I create image on 96 ppi monitor as 100 px * 100 px, then I should modify it to 200 px * 200 px to make it looks same on upper scale monitors (for example 4K with 15 inch).

but CEGUI's layout system using XML format.

so I didn't find any way to resolve it.

Thx!

(Sorry for my poor English)

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Is there any way to support HIDPI?

Postby Ident » Wed Jan 03, 2018 08:03

I understood the issue and I explained the approach I would take in my initial response. It is obvious that the pixel sizes and distances will increase if you have a larger resolution and use a relatively positiond and sized layout.

just different distance between each component.

You will not just need different distances but also need different sizes or the whole thing would not make sense.

The relative distances and relative sizes should stay the same if you scale for higher DPI. That's what I have been saying..
CrazyEddie: "I don't like GUIs"

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: Is there any way to support HIDPI?

Postby mintogo » Wed Jan 03, 2018 10:01

Ident wrote:I understood the issue and I explained the approach I would take in my initial response. It is obvious that the pixel sizes and distances will increase if you have a larger resolution and use a relatively positiond and sized layout.

just different distance between each component.

You will not just need different distances but also need different sizes or the whole thing would not make sense.

The relative distances and relative sizes should stay the same if you scale for higher DPI. That's what I have been saying..


Oh! Ok I just now check it various resolution and dpi, I see it's alright fine.
I think CEGUI automatically rescale GUI based on dpi or resolution, is it alright?

manhnt
Just popping in
Just popping in
Posts: 13
Joined: Thu Oct 26, 2017 01:52

Re: Is there any way to support HIDPI?

Postby manhnt » Wed Jan 03, 2018 13:55

Yes, CEGUI scales automatically, based on resolution and ratio you set for the window.

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: Is there any way to support HIDPI?

Postby mintogo » Wed Jan 03, 2018 14:23

manhnt wrote:Yes, CEGUI scales automatically, based on resolution and ratio you set for the window.


Thank you for reply!

Now I understand how it working.

GUI scale is fine but, scale of text in label(Generic/Label) is not match as resolution.

I guess it because of dpi value for font scale in CEGUI engine is fixed(as 96), is it right?

then how can I resolve font scale problem?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Is there any way to support HIDPI?

Postby Ident » Wed Jan 03, 2018 16:22

Read the documentation
CrazyEddie: "I don't like GUIs"

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: Is there any way to support HIDPI?

Postby mintogo » Thu Jan 04, 2018 02:16

Ident wrote:Read the documentation


Ok I will check that!

Thank you! :idea:

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Is there any way to support HIDPI?

Postby Ident » Thu Jan 04, 2018 06:37

Or rather: read what I already wrote about font scaling..
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 21 guests