MyGUI_SimpleText.cpp
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_SimpleText.h"
#include "MyGUI_RenderItem.h"
#include "MyGUI_LayerNode.h"
#include "MyGUI_FontManager.h"
#include "MyGUI_CommonStateInfo.h"
#include "MyGUI_RenderManager.h"
namespace MyGUI
{
SimpleText::SimpleText()
{
mIsAddCursorWidth = false;
}
void SimpleText::setViewOffset(const IntPoint& _point)
{
}
void SimpleText::doRender()
{
bool _update = mRenderItem->getCurrentUpdate();
if (_update)
mTextOutDate = true;
if (nullptr == mFont)
return;
if (!mVisible || mEmptyView)
return;
if (mTextOutDate)
updateRawData();
const IntSize& size = mTextView.getViewSize();
if (mTextAlign.isRight())
mViewOffset.left = -(mCoord.width - size.width);
else if (mTextAlign.isHCenter())
mViewOffset.left = -((mCoord.width - size.width) / 2);
else
mViewOffset.left = 0;
if (mTextAlign.isBottom())
mViewOffset.top = -(mCoord.height - size.height);
else if (mTextAlign.isVCenter())
mViewOffset.top = -((mCoord.height - size.height) / 2);
else
mViewOffset.top = 0;
Base::doRender();
}
} // namespace MyGUI
MyGUI_CommonStateInfo.h
MyGUI_FontManager.h
MyGUI_LayerNode.h
MyGUI_Precompiled.h
MyGUI_RenderItem.h
MyGUI_RenderManager.h
MyGUI_SimpleText.h
MyGUI::EditText::mEmptyView
bool mEmptyView
Definition MyGUI_EditText.h:134
MyGUI::EditText::mFont
IFont * mFont
Definition MyGUI_EditText.h:150
MyGUI::EditText::mTextView
TextView mTextView
Definition MyGUI_EditText.h:175
MyGUI::EditText::mIsAddCursorWidth
bool mIsAddCursorWidth
Definition MyGUI_EditText.h:168
MyGUI::EditText::mTextOutDate
bool mTextOutDate
Definition MyGUI_EditText.h:142
MyGUI::EditText::mViewOffset
IntPoint mViewOffset
Definition MyGUI_EditText.h:163
MyGUI::EditText::mTextAlign
Align mTextAlign
Definition MyGUI_EditText.h:143
MyGUI::EditText::mRenderItem
RenderItem * mRenderItem
Definition MyGUI_EditText.h:166
MyGUI::EditText::updateRawData
void updateRawData() const
Definition MyGUI_EditText.cpp:458
MyGUI::ICroppedRectangle::mCoord
IntCoord mCoord
Definition MyGUI_ICroppedRectangle.h:245
MyGUI::ISubWidget::mVisible
bool mVisible
Definition MyGUI_ISubWidget.h:68
MyGUI::SimpleText::setViewOffset
void setViewOffset(const IntPoint &_point) override
Definition MyGUI_SimpleText.cpp:24
MyGUI::SimpleText::doRender
void doRender() override
Definition MyGUI_SimpleText.cpp:28
MyGUI::SimpleText::SimpleText
SimpleText()
Definition MyGUI_SimpleText.cpp:18
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30
MyGUI::types::TSize::width
T width
Definition MyGUI_TSize.h:19
MyGUI::types::TSize::height
T height
Definition MyGUI_TSize.h:20