| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #include "CmTestTextSprite.h"
- #include "CmSceneObject.h"
- #include "CmRenderable.h"
- #include "CmMesh.h"
- #include "CmVector2.h"
- #include "BsTextSprite.h"
- #include "CmFont.h"
- #include "CmMaterial.h"
- #include "BsGUILabel.h"
- #include "BsGUISkin.h"
- #include "CmOverlayManager.h"
- using namespace BansheeEngine;
- namespace CamelotEngine
- {
- TestTextSprite::TestTextSprite(const HSceneObject& parent)
- :GUIWidget(parent), mSkin(nullptr)
- {
- }
- TestTextSprite::~TestTextSprite()
- {
- // TODO - temporarily not deleting this
- //if(mSkin != nullptr)
- // CM_DELETE(mSkin, GUISkin, PoolAlloc);
- }
- void TestTextSprite::setText(const HCamera& camera, const String& text, HFont font, UINT32 fontSize)
- {
- mSkin = CM_NEW(GUISkin, PoolAlloc) GUISkin();
- OverlayManager::instance().attachOverlay(camera.get(), this);
- GUIElementStyle labelStyle;
- labelStyle.font = font;
- labelStyle.fontSize = fontSize;
- mSkin->setStyle(BansheeEngine::GUILabel::getGUITypeName(), labelStyle);
- setSkin(mSkin);
- BansheeEngine::GUILabel::create(this, text, 400, 400, true, THA_Right, TVA_Bottom);
- }
- void TestTextSprite::update()
- {
- }
- }
|