generated images from Ogre into an ItemBox

andrewfenn

01-06-2009 04:25:37

I've been trying to figure this out for a few days now and I am stumped on how to do this. What I have completed so far is some functionality that scans a directory for meshes, renders that mesh to render target and then displays that image in a MyGUI::StaticImage. What I am trying to do is instead of displaying that image on a Static Image, instead make each image an icon in my ItemBox so that I can drag these images around the screen. So, get rid of the static images in favour of one ItemBox with my generated images inside and make them drag-able.

The problem however is that I can't figure out how to do it. Using the ItemBox demo I've tried to make it load up my images however the whole demo seems geared towards using an image tileset and having flat file xml data.

From what I can understand I assume all that's required to get a dragable image within the Item box is a class similar to the demo's ItemData which includes the method getImage() ? Does any of this make any sense or am I looking in completely the wrong direction?

Altren

08-06-2009 05:39:12

You can change code and instead lines likemImageItem->setItemName("Normal");in CellView::update use something likemImageItem->setImageTexture(imageName +"Normal.png");or whatever you want.

andrewfenn

18-06-2009 21:44:07

Don't you still need an xml file and icon sheet though? I've been hacking away at this for a while now, however using the method you have described leads me to a dead end. You still need a resource in the beginning otherwise the program crashes and there doesn't seem to be a way to create one in the code, you can only load resources which means loading some kind of XML file which I don't want/need to do.

Also the ItemBox demo includes numerous extra stuff such as CellView, ItemBox, BaseLayout, ItemData, ItemDropInfo, ResourceItemInfo, etc.. Do I really need all this stuff just to get some dragable icons? Is there a way just to make a static image dragable? That would probably be better for what I need.