chipmunk123
23-05-2012 14:09:51
Hi,
I am trying to animate a ImageBox by replacing its current image with a series of images continuously.
After few searches I found out that setImageCoord and SetItemFrameRate have to be used.
I couldn't understand how these functions have to be used to get the required animations
Thank you
dingguanghui
24-05-2012 14:14:34
MyGUI::WindowPtr window = MyGUI::Gui::getInstance().createWidget<MyGUI::Window>("WindowCS", MyGUI::IntCoord(100, 100, 500, 500), MyGUI::Align::Default, "Main");
window->setCaption("ScrollView demo");
MyGUI::ScrollViewPtr view = window->createWidget<MyGUI::ScrollView>("ScrollView", MyGUI::IntCoord(0, 0, window->getClientCoord().width, window->getClientCoord().height), MyGUI::Align::Stretch);
view->setCanvasSize(168, 300);
MyGUI::StaticImagePtr image = view->createWidget<MyGUI::StaticImage>("StaticImage", MyGUI::IntCoord(0, 0, 42, 75), MyGUI::Align::Default);
image->setImageTexture("child.png");
image->addItem(MyGUI::IntCoord(0, 0, 42, 75));
image->addItemFrame(0, MyGUI::IntCoord(42, 0, 42, 75));
image->addItemFrame(0, MyGUI::IntCoord(42*2, 0, 42, 75));
image->addItemFrame(0, MyGUI::IntCoord(42*3, 0, 42, 75));
// image->addItemFrameDublicate(0, 0);
// image->addItemFrameDublicate(0, 3);
image->setItemFrameRate(0, 0.5f);
image->setItemSelect(0);
from mygui repositories.