BUG? FrameComponent and ProgressBar

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

lcy03406
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Fri Apr 24, 2009 01:18

BUG? FrameComponent and ProgressBar

Postby lcy03406 » Tue Oct 20, 2009 09:05

1. In FrameComponent::render_impl(), the clipper is used when rendering the background, but is not used when rendering the other images, the 'frame'.
2. In FalProgressBar::render(), I think progressRect and progressClipper should swap.
Now a ProgressBar which 'progress_light' contains a frame looks strange.

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

Re: BUG? FrameComponent and ProgressBar

Postby CrazyEddie » Tue Oct 20, 2009 10:38

Hi,

Thanks for the info - sounds bug-like; I'll test it out (no fixes 'till after 0.7.1 though).

CE.

lcy03406
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Fri Apr 24, 2009 01:18

Re: BUG? FrameComponent and ProgressBar

Postby lcy03406 » Tue Oct 27, 2009 01:11

I think over and find there is two kinds of 'FrameComponent in ProgressBar'. Suppose here is a ProgressBar's background

bbbbbbbbbbbb
bbbbbbbbbbbb
bbbbbbbbbbbb

and here is a Frame

xxxxxxxxxxxx
xoooooooooox
xxxxxxxxxxxx

When the progress is 50%,which shound the bar looks like?

xxxxxxbbbbbb
xooooobbbbbb
xxxxxxbbbbbb

or

xxxxxxbbbbbb
xooooxbbbbbb
xxxxxxbbbbbb

I want the second one, but I think the first one is also useful somewhere. Which does CEGUI support? Or both, how to specify them?

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

Re: BUG? FrameComponent and ProgressBar

Postby CrazyEddie » Fri Dec 04, 2009 11:19

Both of these scenarios are possible and what gets drawn and how is controlled in the looknfeel specifications. Basically, the imagery specified under the EnabledProgress and DisabledProgress StateImagery parts is drawn into the area specified in the ProgressArea NamedArea, and - crucially - clipped at a point determined by scaling by the current progress. Since you do not want the clipping, all you need to do is scale the areas for the progress imagery by the current progress (i.e. setting the right edge to coincide with the right edge of the clipping area - thus, the imagery is drawn unclipped).

For example, you might have an imagery section named "progress_imagery", and define it as such:

Code: Select all

        <ImagerySection name="progress_imagery" >
            <FrameComponent>
                <Area>
                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
                    <Dim type="Width" >
                        <UnifiedDim scale="1" type="Width">
                            <DimOperator op="Multiply">
                                <PropertyDim name="CurrentProgress" />
                            </DimOperator>
                        </UnifiedDim>
                    </Dim>
                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
                </Area>
                <Image type="TopLeftCorner" imageset="AnImageset" image="FrameTopLeft" />
                <Image type="TopRightCorner" imageset="AnImageset" image="FrameTopRight" />
                <Image type="BottomLeftCorner" imageset="AnImageset" image="FrameBottomLeft" />
                <Image type="BottomRightCorner" imageset="AnImageset" image="FrameBottomRight" />
                <Image type="LeftEdge" imageset="AnImageset" image="FrameLeft" />
                <Image type="TopEdge" imageset="AnImageset" image="FrameTop" />
                <Image type="RightEdge" imageset="AnImageset" image="FrameRight" />
                <Image type="BottomEdge" imageset="AnImageset" image="FrameBottom" />
                <Image type="Background" imageset="AnImageset" image="FrameMiddle" />
            </FrameComponent>
        </ImagerySection>


The important part is where the width is multiplied by the current progress value, here:

Code: Select all

                    <Dim type="Width" >
                        <UnifiedDim scale="1" type="Width">
                            <DimOperator op="Multiply">
                                <PropertyDim name="CurrentProgress" />
                            </DimOperator>
                        </UnifiedDim>
                    </Dim>


HTH

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 6 guests