Animated images.

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
charmy
Just popping in
Just popping in
Posts: 8
Joined: Fri May 06, 2005 20:43

Animated images.

Postby charmy » Tue May 10, 2005 20:12

Is there any support for a sort of "animated image" like a compass for example? Taking an example from EQ, the compass is just a single strip image that scrolls back and forth, or in a loop, depending on your direction, I am curious if CEGUI has any implentation of somthing like this yet or if it needs to be designed.

Thanks Much.

Compass Strip Example.

Image

EDIT: After doing a little research I find that Eq loads the same image twice, i.e. two instances of the compass strip, like so:

Image

My question would now be more so. Does CEGUI have any support for creating an overlay ontop of the image, and is there anyway yet to have them in a sort of "scrolling" effect, or perhaps how to tell what part of the image is showing.. if you understand what i mean... :)

Thanks again for any suggestions.

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: Animated images.

Postby gcarlton » Wed May 11, 2005 01:14

There are widgets that do this, the ScrollablePane is a perfect example.

Try this. Create a window of a small size and then put that long static image into it as child. The smaller parent's clipping size should mean that the child image gets cropped to a subset, and then by moving the child position around you should get the desired result.

User avatar
charmy
Just popping in
Just popping in
Posts: 8
Joined: Fri May 06, 2005 20:43

Re: Animated images.

Postby charmy » Wed May 11, 2005 03:01

Thanks for the reply but for some odd reason when i load the image it gets all distorted =/.

Image

Here is the code used to load the static img.

Code: Select all

   CEGUI::Texture* stctex = this->slOgreRenderer->createTexture("compass.jpg");
   CEGUI::Imageset* rttImageSet = CEGUI::ImagesetManager::getSingleton().createImageset("CompassImg",stctex);
   rttImageSet->defineImage("compassStrip",Point(0.0f,0.0f),Size(355,20),Point(0.0,0.0));
   
   StaticImage* simg = (StaticImage*)wMgr.createWindow((utf8*)"TaharezLook/StaticImage", (utf8*)"Demo7/Window2/Image1");
   console->addChildWindow(simg);
   //simg->setAlpha(0.750000);
   simg->setMaximumSize(Size(1.0f, 1.0f));
   simg->setPosition(Point(0.56f, 0.35f));
   simg->setSize(Absolute ,Size(355, 20));
   simg->setFrameEnabled(false);
   simg->setBackgroundEnabled(false);
   simg->setImage((utf8*)"CompassImg",(utf8*)"compassStrip");


Thanks again for the help.

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: Animated images.

Postby gcarlton » Thu May 12, 2005 05:22

Wierd. You might have to step into the library code and have a look at what its doing with the abs_rect structures and the like. I'm not sure why it would squash it like that.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests