Running chromium embedded framework(cef) browser in paracraft
将cef_win64/Release/libcef.zip解压到当前目录成cef_win64/Release/libcef.dll (文件太大, git不支持)
- clone NplBrowser and its submodule
git clone --recursive https://github.com/tatfook/NplBrowser.git
- run cmd
.\build.bat
- check binaries at: deps/NPLRuntime/ParaWorld/bin32/cef3
- build nplruntime [optional]
- build boost 1.68.0, set environment: BOOST_ROOT
# debug
.\b2.exe address-model=32 toolset=msvc-14.1 runtime-link=static threading=multi variant=debug --with-thread --with-date_time --with-filesystem --with-system --with-chrono --with-signals --with-serialization --with-iostreams --with-regex stage
# release
.\b2.exe address-model=32 toolset=msvc-14.1 runtime-link=static threading=multi variant=release --with-thread --with-date_time --with-filesystem --with-system --with-chrono --with-signals --with-serialization --with-iostreams --with-regex stage
- build nplruntime
-
NplBrowser depends on cef3 03/08/2019 - CEF 3.3626.1895.g7001d56 / Chromium 72.0.3626.121
-
build boost
cefclient.exe -window_title="NplBrowser" -window_name="nplbrowser_wnd" -bounds="0,0,800,600" -url="https://keepwork.com"
- the main logic is in NplBrowserPlugin
---------------------------------------------------------------------------
NPL.load("(gl)script/apps/Aries/Creator/Game/NplBrowser/NplBrowserPlugin.lua");
local NplBrowserPlugin = commonlib.gettable("NplBrowser.NplBrowserPlugin");
local id = "nplbrowser_wnd";
NplBrowserPlugin.Start({id = id, url = "http://www.keepwork.com", withControl = true, x = 200, y = 200, width = 800, height = 600, });
NplBrowserPlugin.OnCreatedCallback(id,function()
NplBrowserPlugin.Open({id = id, url = "http://www.keepwork.com", resize = true, x = 100, y = 100, width = 300, height = 300, });
NplBrowserPlugin.Show({id = id, visible = false});
NplBrowserPlugin.Show({id = id, visible = true});
NplBrowserPlugin.Zoom({id = id, zoom = 1}); --200%
NplBrowserPlugin.EnableWindow({id = id, enabled = false});
NplBrowserPlugin.ChangePosSize({id = id, x = 100, y = 100, width = 800, height = 400, });
NplBrowserPlugin.Quit({id = id,});
end)
---------------------------------------------------------------------------
- NplBrowserPage is more easier for creating cef browser window in npl
NPL.load("(gl)script/apps/Aries/Creator/Game/NplBrowser/NplBrowserPage.lua");
local NplBrowserPage = commonlib.gettable("NplBrowser.NplBrowserPage");
NplBrowserPage.Open();
- Cef3 wiki
- cef cmd line
- NplBrowser assets(deprecated)