StaticImage and setting image
I've got a problem with setting image to StaticImage widget.
In one of my widgets, I have few StaticImages and in game I'm changing theirs contents (images). This images are from one image set, and here is no problem.
But in other widget I have one StaticImage, and I want to change its image like earlier ( and I'm doing it in the same way ). But this time, image hasn't changes. No matter if images.
I'm doing it by using methods:
after that, in my pSI object, texture, resource etc aren't null ( I chekced in debug ), but in game widget is empty.
I was trying to use setImageTexture() or to change widget from StaticImage to simple Widget and _setTextureName(), but with no effects.
Of course all paths to images, which I want to use, are in resource.cfg and there are exists.
So you can't see them even when you setting same textures that you use for another StaticImages that you can see? If yes then probably your widget is hidden, have 0 size, 0 alpha or something else that you may set and forgot about it. If no - show me your layout with this StaticImage that you can't see of code where you create it.
Widget isn't hidden, it has size, texture have correct UV etc. As I said even filed in object looks fine (names, not null pointers to texture). Sometimes ( I don't know when :/ i didn't notice any dependence when it's happens) Image is visible. When I put texture name in layout file, then image is visible in game, but when I change it to another one it "disappear".
I will put layout file tomorrow, right now I haven't access to it.
it's my layput file:
<?xml version="1.0" encoding="UTF-8"?>
<Widget type="Widget" skin="Item_big" position_real="0.25 0.0433333 0.5 0.843333" layer="Back" name="item_big">
<UserString key="script" value="item_bigpanel.lua"/>
<Widget type="StaticImage" skin="StaticImage" position_real="0.152778 0.16469 0.711111 0.674572" layer="Back" name="Image">
<UserString key="eventMouseClick" value="ItemClick"/>
<Widget type="Button" skin="ButtonXItem_big" position_real="0.925 0.0250329 0.0513889 0.0540184" layer="Back">
<UserString key="eventMouseClick" value="CloseButtonClick"/>
OK, I found a problem.
When all images are in one ResourceImageSet, and in one group of it , then all is OK, images are changing.
But when there are in different ResourceImageSets, or in one but in different groups, then when I change image in widget, It isn't visible :/.
You should set not only image: when you have images in different groups you should also set group.
As I wrote in first post, I'm setting group and resource (and image of course) every time, but it doesn't work.
I was trying it on some old (two months old) version from svn, and today I tried do this on MyGUI 3.0 and the effects are the same.
// My bad, with 3.0 everything works fine, with earlier version was crap