27 mCurrentColourNative(0x00FFFFFF),
28 mInverseColourNative(0x00000000),
29 mCurrentAlphaNative(0xFF000000),
30 mShadowColourNative(0x00000000),
32 mTextAlign(
Align::Default),
34 mShadowColour(
Colour::Black),
39 mBackgroundNormal(true),
43 mVisibleCursor(false),
49 mIsAddCursorWidth(true),
99 bool need_update =
true;
168 if (
nullptr !=
mNode)
184 if (
nullptr !=
mNode)
195 if (
nullptr !=
mNode)
199 void EditText::checkVertexSize()
219 _setTextColour(_value);
222 void EditText::_setTextColour(
const Colour& _value)
235 if (
nullptr !=
mNode)
255 if (
nullptr !=
mNode)
268 if (
mFont !=
nullptr)
295 if (
nullptr !=
mNode)
309 if (
nullptr !=
mNode)
356 if (
nullptr !=
mNode)
371 if (
nullptr !=
mNode)
386 if (
nullptr !=
mNode)
401 if (
nullptr !=
mNode)
409 if (
nullptr !=
mNode)
443 if (
nullptr !=
mNode)
454 if (
nullptr ==
mFont)
470 if (
nullptr ==
mFont)
490 if (
nullptr !=
mNode)
499 if (
nullptr !=
mNode)
505 if (
nullptr ==
mFont)
543 size_t vertexCount = 0;
560 for (VectorLineInfo::const_iterator line = textViewData.begin(); line != textViewData.end(); ++line)
564 for (VectorCharInfo::const_iterator sim = line->simbols.begin(); sim != line->simbols.end(); ++sim)
568 colour = sim->getColour() | (colour & 0xFF000000);
569 inverseColour = colour ^ 0x00FFFFFF;
570 selectedColour =
mInvertSelect ? inverseColour : colour | 0x00FFFFFF;
577 float fullAdvance = sim->getBearingX() + sim->getAdvance();
582 vertexRect.
set(left, top, left + fullAdvance, top + (
float)
mFontHeight);
584 drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, selectedUVRect, selectedColour);
590 vertexRect.
left = left + sim->getBearingX() + 1.0f;
591 vertexRect.
top = top + sim->getBearingY() + 1.0f;
592 vertexRect.
right = vertexRect.
left + sim->getWidth();
593 vertexRect.
bottom = vertexRect.
top + sim->getHeight();
595 drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, sim->getUVRect(),
mShadowColourNative);
599 vertexRect.
left = left + sim->getBearingX();
600 vertexRect.
top = top + sim->getBearingY();
601 vertexRect.
right = vertexRect.
left + sim->getWidth();
602 vertexRect.
bottom = vertexRect.
top + sim->getHeight();
604 drawGlyph(renderTargetInfo, vertex, vertexCount, vertexRect, sim->getUVRect(), (!select || !
mInvertSelect) ? colour : inverseColour);
634 if (
nullptr !=
mNode)
655 if (
nullptr !=
mNode)
668 if (
nullptr !=
mNode)
677 void EditText::drawQuad(
679 size_t& _vertexCount,
685 _vertex[0].
x = _vertexRect.
left;
686 _vertex[0].
y = _vertexRect.
top;
687 _vertex[0].
z = _vertexZ;
688 _vertex[0].
colour = _colour;
689 _vertex[0].
u = _textureRect.
left;
690 _vertex[0].
v = _textureRect.
top;
692 _vertex[2].
x = _vertexRect.
left;
693 _vertex[2].
y = _vertexRect.
bottom;
694 _vertex[2].
z = _vertexZ;
695 _vertex[2].
colour = _colour;
696 _vertex[2].
u = _textureRect.
left;
697 _vertex[2].
v = _textureRect.
bottom;
699 _vertex[1].
x = _vertexRect.
right;
700 _vertex[1].
y = _vertexRect.
top;
701 _vertex[1].
z = _vertexZ;
702 _vertex[1].
colour = _colour;
703 _vertex[1].
u = _textureRect.
right;
704 _vertex[1].
v = _textureRect.
top;
706 _vertex[3].
x = _vertexRect.
right;
707 _vertex[3].
y = _vertexRect.
top;
708 _vertex[3].
z = _vertexZ;
709 _vertex[3].
colour = _colour;
710 _vertex[3].
u = _textureRect.
right;
711 _vertex[3].
v = _textureRect.
top;
713 _vertex[5].
x = _vertexRect.
left;
714 _vertex[5].
y = _vertexRect.
bottom;
715 _vertex[5].
z = _vertexZ;
716 _vertex[5].
colour = _colour;
717 _vertex[5].
u = _textureRect.
left;
718 _vertex[5].
v = _textureRect.
bottom;
720 _vertex[4].
x = _vertexRect.
right;
721 _vertex[4].
y = _vertexRect.
bottom;
722 _vertex[4].
z = _vertexZ;
723 _vertex[4].
colour = _colour;
724 _vertex[4].
u = _textureRect.
right;
725 _vertex[4].
v = _textureRect.
bottom;
731 void EditText::drawGlyph(
732 const RenderTargetInfo& _renderTargetInfo,
734 size_t& _vertexCount,
745 _textureRect.left += _textureRect.width() * leftClip / _vertexRect.width();
746 _vertexRect.left += leftClip;
756 if (rightClip > 0.0f)
760 _textureRect.right -= _textureRect.width() * rightClip / _vertexRect.width();
761 _vertexRect.right -= rightClip;
775 _textureRect.top += _textureRect.height() * topClip / _vertexRect.height();
776 _vertexRect.top += topClip;
786 if (bottomClip > 0.0f)
790 _textureRect.bottom -= _textureRect.height() * bottomClip / _vertexRect.height();
791 _vertexRect.bottom -= bottomClip;
803 ((_renderTargetInfo.pixScaleX * pix_left + _renderTargetInfo.hOffset) * 2.0f) - 1.0f,
804 -(((_renderTargetInfo.pixScaleY * pix_top + _renderTargetInfo.vOffset) * 2.0f) - 1.0f),
805 ((_renderTargetInfo.pixScaleX * (pix_left + _vertexRect.width()) + _renderTargetInfo.hOffset) * 2.0f) - 1.0f,
806 -(((_renderTargetInfo.pixScaleY * (pix_top + _vertexRect.height()) + _renderTargetInfo.vOffset) * 2.0f) - 1.0f));
808 drawQuad(_vertex, _vertexCount, vertexRect,
mNode->
getNodeDepth(), _textureRect, _colour);