59 return ColourValue(0, 0, 0);
61 return ColourValue(Value, 0, 0);
63 return ColourValue(0, Value, 0);
65 return ColourValue(Value, Value, 0);
67 return ColourValue(0, 0, Value);
69 return ColourValue(0, Value, Value);
71 return ColourValue(Value, 0, Value);
73 return ColourValue(Value, Value, Value);
75 return ColourValue(Value * 0.9, Value * 0.9, Value * 0.9);
77 return ColourValue(0.5, 0.5, Value * 0.9);
79 return ColourValue::Black;
86 DisplayString text = DisplayString(otext.c_str());
87 DisplayString StrippedText;
89 for (i = 0; i < (int)text.size() - 1; ++i)
92 text[i + 1] >=
'0' && text[i + 1] <=
'9')
98 StrippedText.append(1, text[i]);
102 if (i < (
int)text.size())
103 StrippedText.append(1, text[i]);
109 return String(
"UTF8 error (String cannot be displayed with current font set)");
145 if (!mRenderOp.vertexData)
148 RGBA topColour, bottomColour;
150 Root::getSingleton().convertColourValue(ColourValue::White, &topColour);
151 Root::getSingleton().convertColourValue(ColourValue::White, &bottomColour);
153 HardwareVertexBufferSharedPtr vbuf =
154 mRenderOp.vertexData->vertexBufferBinding->getBuffer(
COLOUR_BINDING);
158 RGBA* pDest = (RGBA*)malloc(vbuf->getSizeInBytes());
161 for (
size_t i = 0; i < mAllocSize; ++i)
170 *pDest++ = topColour;
171 *pDest++ = bottomColour;
172 *pDest++ = topColour;
174 *pDest++ = topColour;
175 *pDest++ = bottomColour;
176 *pDest++ = bottomColour;
178 vbuf->writeData(0, vbuf->getSizeInBytes(), oDest,
true);
void setValueBottom(float Value)
void setCaption(const Ogre::DisplayString &text)
std::vector< unsigned char > m_Colors
static Ogre::ColourValue GetColor(unsigned char ID, float Value=1.0f)
void setValueTop(float Value)
ColoredTextAreaOverlayElement(const Ogre::String &name)
~ColoredTextAreaOverlayElement(void)
static Ogre::DisplayString StripColors(const Ogre::String &text)