Hi,
Now it is time for an update.
The documentation is now ready.
This should be enough to get a sufficient overview of the functions of the nuclear engine.
In the download there is another folder ("doc"). In it you can find the PDF. And a directory ("Source") which contains the source code of the examples in the documentation.
Beside the documentation some new commands were added and bugfixes were made.
But the most important change is that the engine now supports UTF-8 encoding. (to a certain degree).
The Unicode ranges have to be added by hand. Otherwise the font texture (atlas) would become much too big if all possible languages were supported.
An example can be found in the documentation (Listing 17).
#import_plugin Nuklear as nk
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "First Nuklear Window" )
SetWindowSize( 1280, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1280, 720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 0, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
#insert "../Nuklear.agc"
// basic nuklear initialization
nkInit()
nk.FontStashBegin()
nk.FontSetGlyphRange(NK_GLYPHRANGE_CYRILLIC)
nk.FontAtlasAddFromSystem("cyrillic14", "segoeui.ttf", 24)
nk.FontSetGlyphRange(NK_GLYPHRANGE_CHINESE)
if nk.FontAtlasAddFromFile("chinese14", "media/NotoSansSC-Regular.otf", 24) <= 0 then message("error")
nk.FontSetGlyphRange(NK_GLYPHRANGE_KOREAN)
nk.FontAtlasAddFromFile("korean14", "media/BMYEONSUNG_ttf.ttf", 24)
nk.FontSetGlyphRange(NK_GLYPHRANGE_JAPANESE)
nk.FontAtlasAddFromFile("japanese14", "media/ume-hgo4.ttf", 24)
nk.FontSetGlyphRange(NK_GLYPHRANGE_GREEK)
nk.FontAtlasAddFromSystem("greek14", "segoeui.ttf", 24)
// vietnamese unicode range
nk.FontSetGlyphRange(NK_GLYPHRANGE_DEFAULT)
nk.FontAddGlyphRange(0x0102, 0x0103)
nk.FontAddGlyphRange(0x0110, 0x0111)
nk.FontAddGlyphRange(0x0128, 0x0129)
nk.FontAddGlyphRange(0x0168, 0x0169)
nk.FontAddGlyphRange(0x01a0, 0x01b0)
nk.FontAddGlyphRange(0x1ea0, 0x1ef9)
nk.FontAtlasAddFromSystem("vietnamese14", "segoeui.ttf", 24)
nk.FontStashEnd()
do
// pass agk inputs to nuklear
nk.HandleInput()
nk.StyleSetFont("cyrillic14")
if nk.WindowBegin("Мое первое окно (Cyrillic)", 40, 25, 400, 200, NK_WINDOW_BORDER||NK_WINDOW_MOVABLE||NK_WINDOW_TITLE)
endif
nk.WindowEnd()
nk.StyleSetFont("chinese14")
if nk.WindowBegin("迈恩斯特斯·芬斯特 (Chinese)", 450, 25, 400, 200, NK_WINDOW_BORDER||NK_WINDOW_MOVABLE||NK_WINDOW_TITLE)
endif
nk.WindowEnd()
nk.StyleSetFont("korean14")
if nk.WindowBegin("내 첫 창 (Korean)", 860, 25, 400, 200, NK_WINDOW_BORDER||NK_WINDOW_MOVABLE||NK_WINDOW_TITLE)
endif
nk.WindowEnd()
nk.StyleSetFont("japanese14")
if nk.WindowBegin("私の最初のウィンドウ (Japanese)", 40, 250, 400, 200, NK_WINDOW_BORDER||NK_WINDOW_MOVABLE||NK_WINDOW_TITLE)
endif
nk.WindowEnd()
nk.StyleSetFont("greek14")
if nk.WindowBegin("Το πρώτο μου παράθυρο (Greek)", 450, 250, 400, 200, NK_WINDOW_BORDER||NK_WINDOW_MOVABLE||NK_WINDOW_TITLE)
endif
nk.WindowEnd()
nk.StyleSetFont("vietnamese14")
if nk.WindowBegin("Cửa sổ đầu tiên của tôi (Vietnamese)", 860, 250, 400, 200, NK_WINDOW_BORDER||NK_WINDOW_MOVABLE||NK_WINDOW_TITLE)
endif
nk.WindowEnd()
nkSync()
loop
The first post in this thread was updated (change log and download)
Have fun with it and stay healthy.