示例#1
0
	std::string SkinExportSerializer::convertEditorToExportAlign(const std::string& _value)
	{
		MyGUI::Align align = MyGUI::Align::parse(_value);

		if (align.isHCenter())
			align |= MyGUI::Align::HStretch;
		if (align.isVCenter())
			align |= MyGUI::Align::VStretch;

		if (align == MyGUI::Align::Stretch)
			return "Stretch";
		else if (align == MyGUI::Align::Center)
			return "Center";

		return align.print();
	}
示例#2
0
	void TextView::update(const MyGUI::UString& _text, const Sandbox::FontPtr& _font , MyGUI::Align _align, int _maxWidth)
	{
		
        m_font = _font;
		mViewSize.clear();
        mTextData.Clear();
        
        FontAlign align = ALIGN_LEFT;
        if (_align.isHCenter())
            align = ALIGN_CENTER;
        if (_align.isRight())
            align = ALIGN_RIGHT;
        
        mTextData.Fill(_text.c_str(), _font, _maxWidth, align);

		mViewSize = MyGUI::IntSize(mTextData.size.w,mTextData.size.h);
	}