Page 1 of 1

Image-scalable absolute-dims

Posted: Thu Apr 16, 2009 03:39
by Phobius
Greetings. I've been using CEGUI for a while now and have one fundamental issue to which i'm hoping someone has a clever solution. When I write my looknfeel files, I am currently forced to use a lot of <DimOperator>s with <ImageDim>s in order to combat the scaling issue.

Now to explain my problem in full. I want my GUI to be proportionally the same on every single resolution it is ever viewed on. Naturally, for this purpose I set AutoScaled to "true" in the imageset file. This brings up a problem for which I will use the example of a simple editbox. The textarea of an editbox is to sit inside the confines of the editbox frame. With AutoScaled set to "false", this would be as simple as making the top and left edges start at <AbsoluteDim value="whatever the pixel offset from the left or top edge of the editbox graphic to the place in the graphic where the textbox should start is"/>. With AutoScaled as "true", this is no longer so simple.

I have a GUI design where corner pieces of some frames or buttons are not exactly where i want things like textboxes to start. I am therefore forced to create "dummy" image definitions in my imageset so that when i use these with <ImageDim>, they scale correctly along with the rest of the images in the imageset. <AbsoluteDim> does not scale along with the AutoScaled images and therefore cannot be used to offset when autoscaling is enabled.

My ultimate question is: Is there some feature in CEGUI that "enables" my <AbsoluteDim>s to be scaled as per the images that they are positioning?
--Or--
Is there another, cleaner way to do this?

If we thing about the syntax of the looknfeel file, then all you'd need to do would be to take the existing <AbsoluteDim> syntax and give it an extra parameter like "imageset" that would define the imageset to which your absolute dimensions scale.

Thanks.

P.S.
I'm being presumptuous in the sense that this isn't done. If it is, all i need is a pointer to the right documentation. Thank you again.

Posted: Thu Apr 16, 2009 08:46
by CrazyEddie
Hi, and welcome :)

Yeah, I understand the issue you're having, though unfortunately on this occasion I'm not aware of any clever solutions to the issue :?

I think we're going to have to add it as a feature request and extend the system to support this. I envision adding an AutoscaleDim or something to enable this support.

CE.

Posted: Thu Apr 16, 2009 10:14
by Phobius
No worries. All I needed to know was that I wasn't wasting my time =). Thanks. Time to soldier on with my dummy imageset images idea.

Posted: Thu Apr 16, 2009 10:49
by CrazyEddie
I'll add this to my list of planned enhancements to the looknfeel system :)