Imageset size strange error

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
kabutor
Just popping in
Just popping in
Posts: 2
Joined: Wed Jan 12, 2005 12:06

Imageset size strange error

Postby kabutor » Tue Jan 04, 2005 15:00

Hi, I try searching but havent found nothing, so Im making some tests with cegui (nice job btw) :) but encountered a strange problem.

I have a 420x200 size tga image so I made a fblogo.imageset like this

Code: Select all

<?xml version="1.0" ?>
<Imageset Name="FreebootersLogo" Imagefile="./cegui/imagesets/fblogo.tga" NativeHorzRes="420" NativeVertRes="200" AutoScaled="true">
        <Image Name="FBLogo" XPos="0" YPos="0" Width="420" Height="200" />
</Imageset>


So later I just load it in like this (jut copy & paste from demo code 7)

Code: Select all

      // replace frame and backdrop images
                 StaticImage* ologo = (StaticImage*)WindowManager::getSingleton().createWindow((utf8*)"TaharezLook/StaticImage", (utf8*)"FrameBoo Logo");
                 panel->addChildWindow(ologo);
                 ologo->setFrameEnabled(false);
                 ologo->setBackgroundEnabled(false);
                 ologo->setImage(&giset->getImage((utf8*)"FBLogo"));
                 ologo->setPosition(Point(0 ,0));
                 ologo->setSize(Size(0.3f, 0.3f));
                 ologo->setAlwaysOnTop(true);
                 ologo->setAlpha(0.9f);
                 ologo->setEnabled(false);
                 ologo->setInheritsAlpha(false);


Amd it shows, but its missing about 50 pixels left of the image, and some ones in the bottom.

Tjhe only way to "fix it" is change in the imageset xml the values in Width="420" Height="200" by Width="511" Height="250" so supposedly Im a bit "out of bounds".

Something Im doing must be wrong no idea Thx for any help

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

Imageset size strange error

Postby CrazyEddie » Wed Jan 05, 2005 19:30

Which renderer was this with?

In any case, your image files should all be saved with the width and height being some power of two, this is basically required due to the nature of the underlying systems (the file is used as a 3D texture, which need to be powers of 2). Depending upon the renderer, the image may be stretched to a more appropriate size, which is giving you the problems you are having.

HTH

CE.

User avatar
kabutor
Just popping in
Just popping in
Posts: 2
Joined: Wed Jan 12, 2005 12:06

Imageset size strange error

Postby kabutor » Thu Jan 06, 2005 15:48

Ogre renderer.

I just resize it to 256x256 and it works fine, really strange as I was working with another 500x500 image with several icons inside and was working fine ?¿

I resize all of them just for sure. Thx :)

turkeypotpie
Just popping in
Just popping in
Posts: 3
Joined: Mon Apr 03, 2006 23:41

request to throw an exception

Postby turkeypotpie » Fri Apr 21, 2006 00:03

Hi, could you throw an exception when the imageset's size is not a power of two?

I had the same problem as the above post, and it took me a while to figure it out.

Thanks.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue Apr 25, 2006 16:16

I have added a ticket to our tracker so this is'nt forgotten. And it IS really annoying. Hopefully we can have it fixed before the next release.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests