diff --git a/Editor/Editor.vcxproj b/Editor/Editor.vcxproj
index bfe0a35c..93c9b9d1 100644
--- a/Editor/Editor.vcxproj
+++ b/Editor/Editor.vcxproj
@@ -57,19 +57,16 @@
NotUsing
Level3
- ..\Nuake;..\Nuake\src\Vendors;..\Nuake\Dependencies\GLEW\include;..\Nuake\Dependencies\GLFW\x64\include;..\Nuake\Dependencies\bullet\src;..\Nuake\Dependencies\assimp\include;%(AdditionalIncludeDirectories)
+ ..\Nuake;..\Nuake\src\Vendors;..\Nuake\Dependencies\GLEW\include;..\Nuake\Dependencies\GLFW\x64\include;..\Nuake\Dependencies\bullet\src;..\Nuake\Dependencies\assimp\include;..\Nuake\src\Vendors\msdfgen;%(AdditionalIncludeDirectories)
Disabled
MultiThreaded
stdcpp17
Console
- Nuake.lib;glfw3dll.lib;glew32s.lib;opengl32.lib;BulletCollision_vs2010_x64_release.lib;BulletDynamics_vs2010_x64_release.lib;LinearMath_vs2010_x64_release.lib;assimp-vc142-mt.lib;%(AdditionalDependencies)
- ..\Nuake\dependencies\GLFW\lib-vc2019;..\Nuake\dependencies\GLEW\lib\Release\x64;..\Nuake\dependencies\bullet\lib\release\x64;..\Nuake\dependencies\assimp\lib;..\bin\Debug-windows-x86_64\Nuake;%(AdditionalLibraryDirectories)
+ Nuake.lib;glfw3dll.lib;glew32s.lib;opengl32.lib;BulletCollision_vs2010_x64_release.lib;BulletDynamics_vs2010_x64_release.lib;LinearMath_vs2010_x64_release.lib;assimp-vc142-mt.lib;freetype.lib;%(AdditionalDependencies)
+ ..\Nuake\dependencies\GLFW\lib-vc2019;..\Nuake\dependencies\GLEW\lib\Release\x64;..\Nuake\dependencies\bullet\lib\release\x64;..\Nuake\dependencies\assimp\lib;..\bin\Debug-windows-x86_64\Nuake;%(AdditionalLibraryDirectories);C:\Dev\Nuake\Nuake\dependencies\freetype-windows-binaries\release static\win64
-
- IF EXIST ..\Nuake\dependencies\GLFW\lib-vc2019\glfw3.dll\ (xcopy /Q /E /Y /I ..\Nuake\dependencies\GLFW\lib-vc2019\glfw3.dll bin\Debug-windows-x86_64\$(ProjectName)\glfw3.dll > nul) ELSE (xcopy /Q /Y /I ..\Nuake\dependencies\GLFW\lib-vc2019\glfw3.dll bin\Debug-windows-x86_64\$(ProjectName)\glfw3.dll > nul)
-
@@ -82,19 +79,27 @@
Console
- Nuake.lib;glfw3dll.lib;glew32s.lib;opengl32.lib;BulletCollision_vs2010_x64_release.lib;BulletDynamics_vs2010_x64_release.lib;LinearMath_vs2010_x64_release.lib;assimp-vc142-mt.lib;%(AdditionalDependencies)
- ..\Nuake\dependencies\GLFW\lib-vc2019;..\Nuake\dependencies\GLEW\lib\Release\x64;..\Nuake\dependencies\bullet\lib\release\x64;..\Nuake\dependencies\assimp\lib;..\bin\Release-windows-x86_64\Nuake;%(AdditionalLibraryDirectories)
+ Nuake.lib;glfw3dll.lib;glew32s.lib;opengl32.lib;BulletCollision_vs2010_x64_release.lib;BulletDynamics_vs2010_x64_release.lib;LinearMath_vs2010_x64_release.lib;assimp-vc142-mt.lib;freetype.lib;%(AdditionalDependencies)
+ ..\Nuake\dependencies\GLFW\lib-vc2019;..\Nuake\dependencies\GLEW\lib\Release\x64;..\Nuake\dependencies\bullet\lib\release\x64;..\Nuake\dependencies\assimp\lib;..\bin\Release-windows-x86_64\Nuake;%(AdditionalLibraryDirectories);C:\Dev\Nuake\Nuake\dependencies\freetype-windows-binaries\release static\win64
-
- IF EXIST ..\Nuake\dependencies\GLFW\lib-vc2019\glfw3.dll\ (xcopy /Q /E /Y /I ..\Nuake\dependencies\GLFW\lib-vc2019\glfw3.dll bin\Release-windows-x86_64\$(ProjectName)\glfw3.dll > nul) ELSE (xcopy /Q /Y /I ..\Nuake\dependencies\GLFW\lib-vc2019\glfw3.dll bin\Release-windows-x86_64\$(ProjectName)\glfw3.dll > nul)
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Nuake.sln b/Nuake.sln
index 1ebc3ed2..70abcea3 100644
--- a/Nuake.sln
+++ b/Nuake.sln
@@ -1,6 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DemoModule", "DemoModule\DemoModule.vcxproj", "{30ABCBF1-1C63-0D3F-856A-E69A7141A82F}"
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Editor", "Editor\Editor.vcxproj", "{8C1A20B0-78BC-4A86-6177-5EDA4DB8D1D6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Nuake", "Nuake\Nuake.vcxproj", "{994AC40D-055F-ECBE-CEE0-8F1E3AB4E8EF}"
@@ -11,6 +13,10 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {30ABCBF1-1C63-0D3F-856A-E69A7141A82F}.Debug|x64.ActiveCfg = Debug|x64
+ {30ABCBF1-1C63-0D3F-856A-E69A7141A82F}.Debug|x64.Build.0 = Debug|x64
+ {30ABCBF1-1C63-0D3F-856A-E69A7141A82F}.Release|x64.ActiveCfg = Release|x64
+ {30ABCBF1-1C63-0D3F-856A-E69A7141A82F}.Release|x64.Build.0 = Release|x64
{8C1A20B0-78BC-4A86-6177-5EDA4DB8D1D6}.Debug|x64.ActiveCfg = Debug|x64
{8C1A20B0-78BC-4A86-6177-5EDA4DB8D1D6}.Debug|x64.Build.0 = Debug|x64
{8C1A20B0-78BC-4A86-6177-5EDA4DB8D1D6}.Release|x64.ActiveCfg = Release|x64
diff --git a/Nuake/Nuake.vcxproj b/Nuake/Nuake.vcxproj
index 40ac004d..41fcf3a5 100644
--- a/Nuake/Nuake.vcxproj
+++ b/Nuake/Nuake.vcxproj
@@ -15,6 +15,7 @@
true
Win32Proj
Nuake
+ 10.0
@@ -56,7 +57,7 @@
NotUsing
Level3
BT_THREADSAFE=1;BT_USE_DOUBLE_PRECISION;GLEW_STATIC;_MBCS;%(PreprocessorDefinitions)
- src\Vendors;Dependencies\GLEW\include;Dependencies\GLFW\x64\include;Dependencies\bullet\src;Dependencies\assimp\include;%(AdditionalIncludeDirectories)
+ .;src\Vendors;Dependencies\GLEW\include;Dependencies\GLFW\x64\include;Dependencies\bullet\src;Dependencies\assimp\include;src\Vendors\sol2;C:\Dev\Nuake\Nuake\src\Vendors\lua\lua-5.4.3\src;%(AdditionalIncludeDirectories);C:\Dev\Nuake\Nuake\src\Vendors\msdfgen\include;C:\Dev\Nuake\Nuake\src\Vendors\msdfgen\include;C:\Dev\Nuake\Nuake\src\Vendors\msdfgen\freetype\include;C:\Dev\Nuake\Nuake\src\Vendors\msdfgen
Disabled
MultiThreaded
stdcpp17
@@ -70,7 +71,7 @@
NotUsing
Level3
BT_THREADSAFE=1;BT_USE_DOUBLE_PRECISION;GLEW_STATIC;_MBCS;%(PreprocessorDefinitions)
- src\Vendors;Dependencies\GLEW\include;Dependencies\GLFW\x64\include;Dependencies\bullet\src;Dependencies\assimp\include;%(AdditionalIncludeDirectories)
+ .;src\Vendors;Dependencies\GLEW\include;Dependencies\GLFW\x64\include;Dependencies\bullet\src;Dependencies\assimp\include;src\Vendors\lua\lua-5.4.3\src;src\Vendors\msdfgen;Vendors\msdf-atlas-gen;src\Vendors\artery-font-format;src\Vendors\msdfgen\include;%(AdditionalIncludeDirectories);C:\Dev\Nuake\Nuake\src\Vendors\msdfgen\include;C:\Dev\Nuake\Nuake\src\Vendors\msdfgen\include;C:\Dev\Nuake\Nuake\src\Vendors\msdfgen\freetype\include;C:\Dev\Nuake\Nuake\src\Vendors\msdfgen
Disabled
MultiThreaded
stdcpp17
@@ -84,7 +85,9 @@
+
+
@@ -102,16 +105,22 @@
+
+
+
+
+
+
@@ -120,6 +129,7 @@
+
@@ -135,6 +145,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,6 +186,13 @@
+
+
+
+
+
+
+
@@ -172,13 +206,475 @@
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Nuake/src/Rendering/Renderer2D.cpp b/Nuake/src/Rendering/Renderer2D.cpp
index 0fd3c26d..d9018ddd 100644
--- a/Nuake/src/Rendering/Renderer2D.cpp
+++ b/Nuake/src/Rendering/Renderer2D.cpp
@@ -1,6 +1,9 @@
#include "Renderer2D.h"
#include "GL/glew.h"
#include "../Core/Maths.h"
+#include
+
+#include "../UI/Nodes/TextNode.h"
Ref Renderer2D::UIShader;
Ref Renderer2D::TextShader;
@@ -64,22 +67,23 @@ Vector2 Renderer2D::CalculateStringSize(const std::string& str, Ref font,
return Vector2(advance, Y);
}
-void Renderer2D::DrawString(const std::string& str, Ref font, Vector2 position, float fontSize)
+void Renderer2D::DrawString(const std::string& str, TextStyle style, Matrix4 model)
{
TextShader->Bind();
TextShader->SetUniformMat4f("projection", Projection);
float advance = 0.0f;
- font->FontAtlas->Bind(5);
+ style.font->FontAtlas->Bind(5);
TextShader->SetUniform1i("msdf", 5);
+
for (char const& c : str) {
- Char& letter = font->GetChar((int)c);
+ Char& letter = style.font->GetChar((int)c);
Matrix4 mat = Matrix4(1.0f);
- mat = glm::translate(mat, Vector3(position.x + advance, position.y - (letter.PlaneBounds.top * fontSize), 0.f));
+ mat = glm::translate(model, Vector3(advance, (letter.PlaneBounds.top * style.fontSize), 0.f));
float scaleX = letter.PlaneBounds.right - letter.PlaneBounds.left;
float scaleY = letter.PlaneBounds.top - letter.PlaneBounds.bottom;
- mat = glm::scale(mat, Vector3(scaleX * fontSize, scaleY * fontSize, 0.f));
+ mat = glm::scale(mat, Vector3(scaleX * style.fontSize, scaleY * style.fontSize, 0.f));
TextShader->SetUniform2f("texPos", letter.AtlasBounds.Pos.x, letter.AtlasBounds.Pos.y);
TextShader->SetUniform2f("texScale", letter.AtlasBounds.Size.x, letter.AtlasBounds.Size.y);
@@ -90,7 +94,7 @@ void Renderer2D::DrawString(const std::string& str, Ref font, Vector2 posi
//TextShader->SetUniform1f("pxRange", 32);
glBindVertexArray(VAO);
glDrawArrays(GL_TRIANGLES, 0, 6);
- advance += letter.Advance * fontSize;
+ advance += letter.Advance * style.fontSize;
}
}
diff --git a/Nuake/src/Rendering/Renderer2D.h b/Nuake/src/Rendering/Renderer2D.h
index a7bc46b2..49855efd 100644
--- a/Nuake/src/Rendering/Renderer2D.h
+++ b/Nuake/src/Rendering/Renderer2D.h
@@ -3,7 +3,7 @@
#include
#include
#include "src/UI/Font/Font.h"
-
+class TextStyle;
class Renderer2D
{
private:
@@ -18,7 +18,7 @@ public:
static void BeginDraw(Vector2 size);
static void DrawRect();
static Vector2 CalculateStringSize(const std::string& str, Ref font, Vector2 position, float fontSize);
- static void DrawString(const std::string& str, Ref font, Vector2 position, float fontSize);
+ static void DrawString(const std::string& str, TextStyle style, Matrix4 model);
static void DrawChar(Char& letter, Ref font, Vector2 position, Vector2 size);
static void EndDraw();
};
\ No newline at end of file
diff --git a/Nuake/src/UI/InterfaceParser.cpp b/Nuake/src/UI/InterfaceParser.cpp
index 1144bd12..545bad35 100644
--- a/Nuake/src/UI/InterfaceParser.cpp
+++ b/Nuake/src/UI/InterfaceParser.cpp
@@ -1,3 +1,29 @@
#include "InterfaceParser.h"
-Ref