Absolute values

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
jwace81
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Wed Jan 12, 2005 12:06

Absolute values

Postby jwace81 » Thu Sep 02, 2004 00:01

how do you use absolute values for size/position of items? as in, being a fixed pixel value and not relative to resolution.

Set the metrics mode to Absolute before setting the size/position.

also, how do you use values relative to the bottom/right side of the screen, instead of the top/left?

I don't think that there is currently a way change where coordinates are specifed from. As for your example, you can't do that from a layout file, unless you know the size of the image and the screen resolution being used. You can adjust the size from the code (using Absolute metrics mode) so that the window is positioned at (ScreenWidth - ImageWidth, 0), and has a size of (ImageWidth, ImageHeight).

J.W.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Absolute values

Postby CrazyEddie » Thu Sep 02, 2004 08:18

I don't think that there is currently a way change where coordinates are specifed from.

This is correct. I'll put it on the TODO list :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Absolute values

Postby CrazyEddie » Thu Sep 02, 2004 18:47

I assume you're using a StaticImage widget to place your image. If the size of this widget is the same pixel size as the image you wish to display, then there is no way that the result could be twice the size since the image would be clipped. If the StaticImage is larger than the image you're placing, then the StaticImage formatting could be set to use the stretch modes, in which case the image will be sized to the same size as the StaticImage widget area; under these circumstances, you should change the formatting to something more appropriate.

There are ways that the system autoscales imagery, if this is happening, in the Imageset definition file that contains the definition of the image, set autoscaling to false.

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Absolute values

Postby CrazyEddie » Sat Sep 04, 2004 07:07

A couple more things: What resolution is this running at? And, does it happen in all resolutions? Depending on these things, it might indicate a problem in the autoscaling system (not disabling itself when told to, or similar).

If you want a work-around, set the formatting on the StaticImage to stretched; this will scale the image back down to the correct size.

Code: Select all

sidebar->setFormatting( HorzStretched, VertStretched );


I'll investigate this later today and hopefully find out what's causing the issue.

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Absolute values

Postby CrazyEddie » Sat Sep 04, 2004 10:50

I did some checking, and coded a small test using your code snippet, and found no problems.

I'd forgotten that default formatting on these widget is to used the stretched mode anyway, so this would suggest an error in the Imageset specification :?

You might like to disregard what I said ealier and set the horizontal formatting to RightAligned and see if that changes anything.

At the moment, a couple of shots would be useful; one showing what the image is supposed to look like, and a second showing what CEGui is doing with it. If you don't want to post on the open forum, sending via PM or email is fine.

Sorry that I haven't been much help so far :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Absolute values

Postby CrazyEddie » Sat Sep 04, 2004 12:31

Thanks for that Rincewind :)

It's worth noting that had the image loaded without being stretched, the large texture size would still have been used, resulting in very inefficient use of the memory on the graphics card. At least when you're aware of the texture size being used it gives you the opportunity to maximise the use of that memory.

I will make a note to fix this though, as it's not doing what it's supposed to do, but I do consider it a low priority for now :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Absolute values

Postby CrazyEddie » Sat Sep 04, 2004 16:04

Somehow I don't get the validation email when registering. That's why I'm still posting as guest


This might be a sourceforge issue. Sometimes you don't get any emails via them for a few days then hundreds turn up at once :lol:

If you like you can email me the necesary details and I'll set up your forum account manually from here.

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 8 guests