diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-30 10:56:54 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-30 10:56:54 -0700 |
commit | d57be9d49c55bc0b85eb8f539ff2029518cfafc0 (patch) | |
tree | df3726aab3d3a4227330496e3b54803a713b1e7d /src/gui/textfield.cpp | |
parent | cc37b4a9153379d5c5529ba85305d36efba2cd85 (diff) | |
download | mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.gz mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.bz2 mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.xz mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.zip |
Exposed most gui elements to take alpha values. There are still a few
spots that could also be fixed up as well, but require other methods to
fix them (the filled color rectangles on the progress bars, as well as
the text on them as well, as an example).
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/textfield.cpp')
-rw-r--r-- | src/gui/textfield.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/textfield.cpp b/src/gui/textfield.cpp index 3ecf5c82..7e5004cc 100644 --- a/src/gui/textfield.cpp +++ b/src/gui/textfield.cpp @@ -39,6 +39,7 @@ #undef DELETE //Win32 compatibility hack int TextField::instances = 0; +float TextField::mAlpha = config.getValue("guialpha", 0.8); ImageRect TextField::skin; TextField::TextField(const std::string& text): @@ -55,9 +56,6 @@ TextField::TextField(const std::string& text): Image *textbox = resman->getImage("graphics/gui/deepbox.png"); int gridx[4] = {0, 3, 28, 31}; int gridy[4] = {0, 3, 28, 31}; - //Image *textbox = resman->getImage("graphics/gui/textbox.png"); - //int gridx[4] = {0, 5, 26, 31}; - //int gridy[4] = {0, 5, 26, 31}; int a = 0, x, y; for (y = 0; y < 3; y++) { @@ -98,6 +96,15 @@ void TextField::draw(gcn::Graphics *graphics) graphics->setColor(getForegroundColor()); graphics->setFont(getFont()); graphics->drawText(mText, 1 - mXScroll, 1); + + if (config.getValue("guialpha", 0.8) != mAlpha) + { + mAlpha = config.getValue("guialpha", 0.8); + for (int a = 0; a < 9; a++) + { + skin.grid[a]->setAlpha(mAlpha); + } + } } void TextField::drawFrame(gcn::Graphics *graphics) |