Giter Club home page Giter Club logo

rmlui's Introduction

RmlUi for Flax Engine

This is the RmlUi plugin for Flax Engine.

The plugin is still under development and currently has support for C++-scripting.

Minimum supported Flax version: 1.7.1.

Installation

  1. Clone the repository into <game-project>\Plugins\RmlUi, or add the repository as a submodule to the game repository.

  2. Add a reference to RmlUi project in your game by modifying <game-project>.flaxproj as follows:

...
"References": [
    {
        "Name": "$(EnginePath)/Flax.flaxproj"
    },
    {
        "Name": "$(ProjectPath)/Plugins/RmlUi/RmlUi.flaxproj"
    }
]
  1. Add a reference to RmlUi plugin module in you game code module by modifying Source/Game/Game.Build.cs as follows (or any other game modules using the plugin):
/// <inheritdoc />
public override void Setup(BuildOptions options)
{
    base.Setup(options);

    ...

    switch (options.Platform.Target)
    {
    case TargetPlatform.Windows:
    case TargetPlatform.Linux:
    case TargetPlatform.Mac:
        options.PublicDependencies.Add("RmlUi");
        break;
    }
}

This will add reference to RmlUi module on Windows/Linux/Mac platforms.

  1. Test it out!

In Flax Editor, the plugin should be listed in the Plugins window under the GUI category.

TODO: Add simple instructions how to use the plugin here. TODO: Add links to example Flax-projects using the plugin here.

License

This plugin is released under the MIT License.

rmlui's People

Contributors

goalitium avatar menotdan avatar withaust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rmlui's Issues

Plugin not loaded properly with VS2022+Flax 1.7 (expected to be compatible)

Added plugin to a clean new project (fresh installed engine v1.7 - couldn't use v1.6 due to VC++ 2022 complier issue)

Opening project shows following error:

---------------------------
Failed to compile scripts
---------------------------
Scripts compilation failed. Cannot load scene without game script modules. Please fix the compilation issues. See logs for more info.
 ---------------------------

And scene loaded broken.

Log trace shows following:

[ 00:00:07.145 ]: [Info] 1:\RmlUITest\Plugins\RmlUi
[ 00:00:07.639 ]: [Info] C:\Program Files (x86)\Flax\Flax_1.7\Source\Engine\Render2D\IncludeFreeType.h(7): fatal error C1083: bugger.dll Files\Microsoft Visual Studio 2022 Enterprise\VC\Tools\M
[ 00:00:07.655 ]: [Info] Task C:\Program Files\Microsoft Visual Studio 2022 Enterprise\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64\cl.exe /nologo /c /std:c++14 /Oi /Gy /analyze- /Zc:inline /Ot /Ob2 /Zi /Zo /Ox /Oi /Oy /FC /errorReport:prompt /EHsc /GF /MD /fp:fast /fp:except- /GS /GR /WX- /W3 /wd"4005" /Zc:wchar_t /D "PLATFORM_WIN32" /D "WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_SECURE_NO_WARNINGS" /D "_WINDOWS" /D "WIN64" /D "PLATFORM_WINDOWS" /D "UNICODE" /D "_UNICODE" /D "USE_EDITOR" /D "BUILD_DEVELOPMENT" /D "NDEBUG" /D "FLAX_1" /D "FLAX_1_7" /D "FLAX_1_1_OR_NEWER" /D "FLAX_1_2_OR_NEWER" /D "FLAX_1_3_OR_NEWER" /D "FLAX_1_4_OR_NEWER" /D "FLAX_1_5_OR_NEWER" /D "FLAX_1_6_OR_NEWER" /D "FLAX_1_7_OR_NEWER" /D "RMLUI_API=__declspec(dllexport)" /D "FLAXENGINE_API=__declspec(dllimport)" /D "COMPILE_WITH_PROFILER" /D "TRACY_ENABLE" /D "TRACY_ON_DEMAND" /D "COMPILE_WITH_DEBUG_DRAW" /D "COMPILE_WITH_SHADER_CACHE_MANAGER" /D "COMPILE_WITH_MODEL_TOOL" /D "COMPILE_WITH_SHADER_COMPILER" /D "COMPILE_WITH_CSG_BUILDER" /D "COMPILE_WITH_NAV_MESH_BUILDER" /D "COMPILE_WITH_NETWORKING" /D "COMPILE_WITH_PHYSICS_COOKING" /D "COMPILE_WITH_PARTICLE_GPU_GRAPH" /D "COMPILE_WITH_GPU_PARTICLES" /D "COMPILE_WITH_ASSETS_IMPORTER" /D "COMPILE_WITH_MATERIAL_GRAPH" /D "COMPILE_WITH_AUDIO_TOOL" /D "COMPILE_WITH_OGG_VORBIS" /D "COMPILE_WITH_TEXTURE_TOOL" /I"C:\Program Files\Microsoft Visual Studio 2022 Enterprise\VC\Tools\MSVC\14.37.32822\include" /I"C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" /I"C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" /I"C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" /I"C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" /I"C:\Program Files (x86)\Flax\Flax_1.7\Source\ThirdParty" /IY:\RmlUITest\Plugins\RmlUi\Source /I"C:\Program Files (x86)\Flax\Flax_1.7\Source" /IY:\RmlUITest\Plugins\RmlUi\Source\RmlUi /IY:\RmlUITest\Plugins\RmlUi\Source\RmlUi\..\ThirdParty\RmlUi /I"C:\Program Files (x86)\Flax\Flax_1.7\Source\ThirdParty\freetype" /Fd"Y:\RmlUITest\Plugins\RmlUi\Cache/Intermediate\RmlUiEditorTarget\Windows\x64\Development\RmlUi\FlaxFontEngineInterface.pdb" /Fo"Y:\RmlUITest\Plugins\RmlUi\Cache/Intermediate\RmlUiEditorTarget\Windows\x64\Development\RmlUi\FlaxFontEngineInterface.obj" "Y:\RmlUITest\Plugins\RmlUi\Source\RmlUi\Flax\FlaxFontEngineInterface.cpp" failed with exit code 2
 
[ 00:00:07.696 ]: [Info] C:\Program Files (x86)\Flax\Flax_1.7\Source\Engine\Graphics\RenderView.h(1): warning C4819: HostX64\x64\cl.exe /nologo /c /std:c++14 /Oi /Gy /analyze- /Zc:inline /Ot /Ob2 /Zi /Zo /Ox /Oi /Oy /FC /errorReport:prompt /EHsc /GF /MD /fp:fa
[ 00:00:07.805 ]: [Info] C:\Program Files (x86)\Flax\Flax_1.7\Source\Engine\Graphics\RenderView.h(1): warning C4819: HostX64\x64\cl.exe /nologo /c /std:c++14 /Oi /Gy /analyze- /Zc:inline /Ot /Ob2 /Zi /Zo /Ox /Oi /Oy /FC /errorReport:prompt /EHsc /GF /MD /fp:fa
[ 00:00:09.211 ]: [Info] 2 tasks failed
[ 00:00:09.215 ]: [Info] Exception: Failed to build target RmlUiEditorTarget. See log.
Stack trace: 
[ 00:00:09.224 ]: [Info]    at Flax.Build.Builder.BuildTargetReferenceNativeCpp(Dictionary`2 buildContext, BuildData buildData, Reference reference) in F:\FlaxEngine\Source\Tools\Flax.Build\Build\NativeCpp\Builder.NativeCpp.cs:line 631
   at Flax.Build.Builder.BuildTargetNativeCpp(RulesAssembly rules, TaskGraph graph, Target target, Dictionary`2 buildContext, Toolchain toolchain, TargetConfiguration configuration, Boolean isBuildingReference, Boolean skipBuild) in F:\FlaxEngine\Source\Tools\Flax.Build\Build\NativeCpp\Builder.NativeCpp.cs:line 764
   at Flax.Build.Builder.BuildTargets() in F:\FlaxEngine\Source\Tools\Flax.Build\Build\Builder.cs:line 371
   at Flax.Build.Program.Main() in F:\FlaxEngine\Source\Tools\Flax.Build\Program.cs:line 150
Total time: 00:00:04.0613974 
[ 00:00:09.232 ]: [Error] Failed to run build tool, result: 1

Using VS 2022 and expected to compatible with RmlUI plugin at Flax 1.7 but it seems troublesome... is there anything I can do for fix?

Plugin load exception

This happens on FlaxEngine/FlaxEngine@ca5cbf0 and 55ec8a4
Exception thrown at 0x00007FFC976805BE in FlaxEditor.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

 	00007ffc976805be()
 	00007ffc97470cac()
 	00007ffc9746d69c()
>	[Inline Frame] FlaxEditor.exe!CallStaticMethod(void *) Line 193
 	FlaxEditor.exe!MMethod::Invoke(void * instance, void * * params, DotNetObject * * exception) Line 1285
 	RmlUi.dll!RegisterRmlUiImporters() Line 71
 	RmlUi.dll!RmlUiEditorPlugin::Initialize() Line 109
 	FlaxEditor.exe!PluginManagerService::InvokeInitialize(Plugin * plugin) Line 119
 	FlaxEditor.exe!PluginManagerImpl::LoadPlugin(MClass * klass, bool isEditor) Line 163
 	FlaxEditor.exe!PluginManagerImpl::OnAssemblyLoaded(MAssembly * assembly) Line 187
 	FlaxEditor.exe!PluginManagerImpl::OnBinaryModuleLoaded(BinaryModule * module) Line 256
 	[Inline Frame] FlaxEditor.exe!Delegate<BinaryModule *>::operator()(BinaryModule *) Line 612
 	FlaxEditor.exe!Scripting::LoadBinaryModules(const String & path, const String & projectFolderPath) Line 422
 	FlaxEditor.exe!Scripting::LoadBinaryModules(const String & path, const String & projectFolderPath) Line 305
 	FlaxEditor.exe!Scripting::Load() Line 520
 	FlaxEditor.exe!ManagedEditor::Init() Line 228
 	FlaxEditor.exe!Editor::Init() Line 664
 	FlaxEditor.exe!Engine::Main(const wchar_t * cmdLine) Line 144
 	FlaxEditor.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 55

Minimal requirement version?

On front page it says

Minimum supported Flax version: 1.6.
But for I tested official 1.6 version installation does not compatible with repository, referencing headers only exists in FlaxEngine bleeding edge repo. (And it has compatibility issue, at least in my case latest 'daily master branch' engine did not executed)

I understand some syntaxes in latest MSVS 2022 compiler has problem with standard 1.6 but the patch applied to engine to cope with VS2022 latest made RmlUI plugin incompatible to 1.6 even though it's mentioned in main README. I hope plugin to be compatible with 1.6, but at least to be fixed the requirement version part if it is not possible.

Download as zip excludes git-lfs files

A few .lib and .flax files are excluded from zip download because of lfs exclusion.
It might be appreciated to make 'releases' or change settings to include lfs files...

Managing Git LFS objects in archives
On GitHub.com, navigate to the main page of the repository.
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.
Under "Archives", select or deselect Include Git LFS objects in archives.

Add support for C#-scripting

Most of the RmlUi classes and structures needs to be wrapped and annotated with Flax.Build macros for C#-bindings generation. Wrappers should also prefer using the engine collection types and math types like vectors and matrices for better interoperability with scripts etc.

Duplicating characters for text fields

Currently, if you were going to open a sample project and change demo.rml in a way that would contain input field like so:

<body template="window">
    This is a sample.
    <input type="text" id="text"></input>
</body>

this results in a field that could be used to test this issue:
image
Any character that gets typed into this input is going to be duplicated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.