Skip to content

Commit c54e724

Browse files
committed
feat : TextRender 컴포넌트 추가
- Text를 레이어 순서대로 그릴수있도록 TextRender 컴포넌트추가
1 parent dc152b5 commit c54e724

File tree

95 files changed

+211
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+211
-178
lines changed

CodeGen/ScriptList.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CCameraMoveScript
2-
CFontScript
32
CLevelChangeScript
43
CPlayButtonScript
54
CPlayerCameraScript

External/Include/Engine/CComponent.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class CComponent : public CEntity
4242
GET_OTHER_COMPONENT(TileMap);
4343
GET_OTHER_COMPONENT(ParticleSystem);
4444
GET_OTHER_COMPONENT(SkyBox);
45+
GET_OTHER_COMPONENT(TextRender);
4546

4647
public:
4748
virtual CComponent* Clone() = 0;

External/Include/Engine/CFontMgr.h

+1-12
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,15 @@
1010

1111
#define FONT_RGBA(r, g, b, a) (((((BYTE)a << 24) | (BYTE)b << 16) | (BYTE)g << 8) | (BYTE)r)
1212

13-
struct tFont
14-
{
15-
wstring _pStr;
16-
float _fPosX;
17-
float _fPosY;
18-
float _fFontSize;
19-
UINT _Color;
20-
};
21-
2213
class CFontMgr : public CSingleton<CFontMgr>
2314
{
2415
private:
2516
IFW1Factory* m_pFW1Factory;
2617
IFW1FontWrapper* m_pFontWrapper;
27-
std::list<tFont> m_ListFont;
2818

2919
public:
3020
void init();
31-
void DrawFont(tFont _Font) { m_ListFont.push_back(_Font); }
32-
void render();
21+
void DrawFont(const wchar_t* _pStr, float _fPosX, float _fPosY, float _fFontSize, UINT _Color);
3322

3423
public:
3524
CFontMgr();

External/Include/Engine/CGameObject.h

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class MeshRender;
2020
class CTileMap;
2121
class CParticleSystem;
2222
class CSkyBox;
23+
class CTextRender;
2324
class CScript;
2425

2526
class CGameObject : public CEntity
@@ -62,6 +63,7 @@ class CGameObject : public CEntity
6263
GET_COMPONENT(TileMap, TILEMAP);
6364
GET_COMPONENT(ParticleSystem, PARTICLESYSTEM);
6465
GET_COMPONENT(SkyBox, SKYBOX);
66+
GET_COMPONENT(TextRender, TEXTRENDER);
6567

6668
CGameObject* GetParent() const { return m_Parent; }
6769
const vector<CScript*>& GetScripts() const { return m_vecScript; }

External/Include/Engine/COutliner.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class COutliner : public CEntity
3737
void DrawParticlesystem(CGameObject* obj);
3838
void DrawSkybox(CGameObject* obj);
3939
void DrawLandscape(CGameObject* obj);
40+
void DrawTextRender(CGameObject* obj);
4041
void DrawScript(CGameObject* obj);
4142

4243
private:

External/Include/Engine/CTextRender.h

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#pragma once
2+
#include "CRenderComponent.h"
3+
4+
class CTextRender : public CRenderComponent
5+
{
6+
private:
7+
wstring m_Text;
8+
Vec2 m_Position;
9+
float m_Size;
10+
Vec4 m_Color;
11+
12+
public:
13+
virtual void UpdateData() override{};
14+
virtual void render() override;
15+
virtual void render(Ptr<CMaterial> _mtrl) override;
16+
17+
public:
18+
const wstring& GetText() const { return m_Text; }
19+
void SetText(const wstring& _Text) { m_Text = _Text; }
20+
21+
Vec2 GetTextPosition() const { return m_Position; }
22+
void SetTextPosition(Vec2 _pos) { m_Position = _pos; }
23+
24+
float GetTextSize() const { return m_Size; }
25+
void SetTextSize(float _size) { m_Size = _size; }
26+
27+
Vec4 GetTextColor() const { return m_Color; }
28+
void SetTextColor(Vec4 _color) { m_Color = _color; }
29+
30+
public:
31+
virtual void SaveToLevelFile(FILE* _File) override;
32+
virtual void LoadFromLevelFile(FILE* _File) override;
33+
34+
CLONE(CTextRender);
35+
36+
public:
37+
CTextRender();
38+
virtual ~CTextRender();
39+
};

External/Include/Engine/components.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
#include "CParticleSystem.h"
2020
#include "CSkybox.h"
2121
// #include "Decal.h"
22-
// #include "Landscape.h"
22+
// #include "Landscape.h"
23+
#include "CTextRender.h"

External/Include/Engine/define.h

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ enum class COMPONENT_TYPE
8989
SKYBOX,
9090
DECAL,
9191
LANDSCAPE,
92+
TEXTRENDER,
9293

9394
END,
9495

External/Include/Engine/func.h

-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ ComPtr<ID3D11Texture2D> CreateStagingTexture(const int width, const int height,
6565
// =====================================
6666
void SaveWStringToFile(const wstring& _str, FILE* _File);
6767
void LoadWStringFromFile(wstring& _str, FILE* _File);
68-
void SaveStringToFile(const string& _str, FILE* _File);
69-
void LoadStringFromFile(string& _str, FILE* _File);
7068

7169
#include "CAssetMgr.h"
7270

External/Include/Scripts/CFontScript.h

-24
This file was deleted.

External/Include/Scripts/CScriptMgr.h

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
enum SCRIPT_TYPE
77
{
88
CAMERAMOVESCRIPT,
9-
FONTSCRIPT,
109
LEVELCHANGESCRIPT,
1110
PLAYBUTTONSCRIPT,
1211
PLAYERCAMERASCRIPT,

0 commit comments

Comments
 (0)