Hello everyone,
I'm trying to create a plugin for my stream, but I'm having some problems with showing and hiding images.
Basically, it's supposed to do two things, the first is to change the text of an element, and the second is to show and hide a few images.
Changing the text was simple:
My idea to hide an image was to set it's opacity to 0, unfortunately, doing that wasn't quite as simple, this is what I've got right now:
The problem is that it doesn't change the opacity "live", it only changes it in the configuration, so if you restart the stream, it will work, or if you open the properties of the image you'll see that the opacity is changed, but it wont update while the stream is running.
Obviously, I'm doing something wrong, but I'm not quite sure what, anyone has any idea how I could make this work?
Thanks!
I'm trying to create a plugin for my stream, but I'm having some problems with showing and hiding images.
Basically, it's supposed to do two things, the first is to change the text of an element, and the second is to show and hide a few images.
Changing the text was simple:
Code:
// Update text
ImageSource *textImageSource = API->GetSceneImageSource(TEXT("StatusText"));
XElement* globalSourceElements = API->GetGlobalSourceListElement();
XElement* textElement = globalSourceElements->GetElement(TEXT("StatusText"));
XElement* data = textElement->GetElement(TEXT("data"));
data->SetString(TEXT("text"), messageText);
if (textImageSource)
textImageSource->SetString(TEXT("text"), messageText);
Code:
// Update image
ImageSource *imageImageSource = API->GetSceneImageSource(TEXT("StatusImage1"));
XElement* globalSourceElements = API->GetGlobalSourceListElement();
XElement* imageElement = globalSourceElements->GetElement(TEXT("StatusImage1"));
XElement* data = imageElement->GetElement(TEXT("data"));
data->SetInt(TEXT("opacity"), opacityValue);
if (imageImageSource)
imageImageSource->UpdateSettings();
Obviously, I'm doing something wrong, but I'm not quite sure what, anyone has any idea how I could make this work?
Thanks!