You.i Engine
YiBitmapTextSceneNode.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_BITMAP_TEXT_SCENE_NODE_H_
3 #define _YI_BITMAP_TEXT_SCENE_NODE_H_
4 
7 
24 {
25 public:
27  virtual ~CYIBitmapTextSceneNode();
28 
35 
36  virtual void SetSize(const glm::vec3 &size, bool dirtyLayout = true) override;
37 
38 protected:
39  virtual void SpecializeTextRenderInfo(CYITextEngine::RenderInfo *pInfo) override;
40 
41 private:
42  void CalculateTextLayoutInfo(const CYITextLayout *pTextLayout, const CYITextEngine::RenderInfo &rTextRenderInfo, YI_FLOAT_RECT *pTextExtents, glm::vec2 *pRenderedSize, float *pVerticalOffset, YI_FLOAT_RECT_REL *pGlyphBox) const;
43 
44  virtual void PrepareToDraw() override;
45  void CreateTextMesh(const YI_FLOAT_RECT_REL &rGlyphBox, const YI_FLOAT_RECT &rTextExtents, const glm::vec2 &rvRenderedSize, float verticalOffset);
46  std::unique_ptr<CYIBitmap> GenerateTextBuffer(const CYITextLayout *pTextLayout, const CYITextEngine::RenderInfo &rTextRenderInfo, const YI_FLOAT_RECT &rTextExtents);
47  static void SetTextBuffer(std::unique_ptr<CYIBitmap> pBuffer, const std::shared_ptr<CYIAssetTexture> &pTexture);
48 
49  std::shared_ptr<CYIAssetTexture> m_pDestBufferAsset;
50 
51  CYIAssetTextureBase::Filtering m_textureMinFilter;
52  CYIAssetTextureBase::Filtering m_textureMagFilter;
53 
55 };
56 
61 #endif // _YI_BITMAP_TEXT_SCENE_NODE_H_
Struct used to pass information when rendering text.
Definition: YiTextEngine.h:210
Filtering
Definition: YiAssetTextureBase.h:28
void SetTextureFilteringMode(const CYIAssetTextureBase::Filtering minFilter, const CYIAssetTextureBase::Filtering magFilter)
virtual ~CYIBitmapTextSceneNode()
virtual void SpecializeTextRenderInfo(CYITextEngine::RenderInfo *pInfo) override
Definition: YiRectangle.h:61
A scene node type that renders text.
Definition: YiTextSceneNode.h:79
Base class for abstracting the layout for text.
Definition: YiTextLayout.h:22
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:259
Definition: YiRectangle.h:86
virtual void SetSize(const glm::vec3 &size, bool dirtyLayout=true) override
Scene node containing text rendered into a bitmap.
Definition: YiBitmapTextSceneNode.h:23