Question about DimOperator

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

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Question about DimOperator

Postby Pompei2 » Sun Apr 01, 2007 19:14

Hello,

Again, a question concerning the look'n'feel files.

How is it possible, using the DimOperator, to do an operation like this:

(Text.H - ImageA.H) / 2

My problem is not getting the Text.H or ImageA.H, I know these, but my problem is the order of the operations. Any hint is appreciated.

phoenixy
Just popping in
Just popping in
Posts: 14
Joined: Tue Feb 27, 2007 01:18

Postby phoenixy » Wed Apr 25, 2007 17:11

I think you can do that in the following order.

AbsoluteDim value='2'
DimOperator op='/' (I'm not sure what the exact op name of /. Divide?)
Text.h
DimOperator op='-'
ImageA.H
/DimOperator
/Text.h
/DimOperator

Since DimOperator does operation from inside to out,
Text.H - ImageA.H is done first (I've learned that the most inside two is done in the same order as they are)
and then using that result the next dimoperator is calculated.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Mon Apr 30, 2007 22:11

Ok, thank you for your answer looks good, but I can't test ... cause i forgot where i needed this :D but .. it seems to me that your code would do a:

2 / (Text.H - Image.H)

no ?
Edit: because if you write:

Code: Select all

<FontDim type="LineSpacing" padding="0">
   <DimOperator op="Divide">
      <AbsoluteDim value="2" />
   </DimOperator>
</FontDim>

this does a linespacing / 2, and not 2 / linespacing. correct me if i'm wrong.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests