|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
#include "screenfader.hpp"
|
|
|
|
|
|
|
|
|
|
#include <MyGUI_RenderManager.h>
|
|
|
|
|
#include <MyGUI_ImageBox.h>
|
|
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
|
{
|
|
|
|
@ -66,20 +67,25 @@ namespace MWGui
|
|
|
|
|
mFader->notifyOperationFinished();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScreenFader::ScreenFader(const std::string & texturePath, const std::string& layout)
|
|
|
|
|
ScreenFader::ScreenFader(const std::string & texturePath, const std::string& layout, const MyGUI::FloatCoord& texCoordOverride)
|
|
|
|
|
: WindowBase(layout)
|
|
|
|
|
, mCurrentAlpha(0.f)
|
|
|
|
|
, mFactor(1.f)
|
|
|
|
|
, mRepeat(false)
|
|
|
|
|
{
|
|
|
|
|
mMainWidget->setSize(MyGUI::RenderManager::getInstance().getViewSize());
|
|
|
|
|
setTexture(texturePath);
|
|
|
|
|
setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenFader::setTexture(const std::string & texturePath)
|
|
|
|
|
{
|
|
|
|
|
mMainWidget->setProperty("ImageTexture", texturePath);
|
|
|
|
|
MyGUI::ImageBox* imageBox = mMainWidget->castType<MyGUI::ImageBox>(false);
|
|
|
|
|
if (imageBox)
|
|
|
|
|
{
|
|
|
|
|
imageBox->setImageTexture(texturePath);
|
|
|
|
|
const MyGUI::IntSize imageSize = imageBox->getImageSize();
|
|
|
|
|
imageBox->setImageCoord(MyGUI::IntCoord(texCoordOverride.left * imageSize.width,
|
|
|
|
|
texCoordOverride.top * imageSize.height,
|
|
|
|
|
texCoordOverride.width * imageSize.width,
|
|
|
|
|
texCoordOverride.height * imageSize.height));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenFader::update(float dt)
|
|
|
|
|