Get font info.

This commit is contained in:
jussi
2022-06-26 15:03:08 +03:00
parent 36baf4c122
commit 314d0412a5
24 changed files with 130 additions and 6 deletions

View File

@@ -14,6 +14,7 @@ function init()
local winSize = RL_GetWindowSize()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
RL_SetWindowTitle( "Camera 2D" )

View File

@@ -74,6 +74,7 @@ function init()
RL_SetExitKey( KEY_ESCAPE )
-- framebuffer = RL_LoadRenderTexture( res )
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
texture = RL_LoadTexture( RL_GetBasePath().."../resources/images/tiles.png" )

View File

@@ -28,6 +28,7 @@ function init()
RL_GuiSetFont( 0 )
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
end

View File

@@ -24,6 +24,7 @@ function init()
local winSize = RL_GetWindowSize()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
camera = RL_CreateCamera3D()

View File

@@ -11,6 +11,7 @@ function init()
local winSize = RL_GetWindowSize()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
image = RL_GenImageColor( winSize[1], winSize[2], WHITE )
-- Test changing working directory.

View File

@@ -18,6 +18,7 @@ function init()
local winSize = RL_GetWindowSize()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
camera = RL_CreateCamera3D()
RL_SetCamera3DPosition( camera, { 0, 2, 4 } )

View File

@@ -16,6 +16,7 @@ function init()
local winSize = RL_GetWindowSize()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
camera = RL_CreateCamera3D()

View File

@@ -12,6 +12,7 @@ local winSize = { res[1] * scale, res[2] * scale }
function init()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
RL_SetWindowSize( winSize )
tex = RL_LoadTexture( RL_GetBasePath().."../resources/images/cat.png" )

View File

@@ -90,9 +90,9 @@ function init()
local monitorPos = Vec2:new( RL_GetMonitorPosition( monitor ) )
local monitorSize = Vec2:new( RL_GetMonitorSize( monitor ) )
RL_SetConfigFlags( FLAG_VSYNC_HINT )
RL_SetWindowTitle( "Platformer" )
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowSize( winSize )
RL_SetWindowPosition( { monitorPos.x + monitorSize.x / 2 - winSize.x / 2, monitorPos.y + monitorSize.y / 2 - winSize.y / 2 } )

View File

@@ -34,9 +34,8 @@ function init()
local mSize = RL_GetMonitorSize( monitor )
local winSize = { 1920, 1080 }
RL_SetConfigFlags( FLAG_VSYNC_HINT )
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
RL_SetWindowSize( winSize )
camera = RL_CreateCamera3D()

View File

@@ -53,6 +53,7 @@ function init()
local mPos = RL_GetMonitorPosition( monitor )
local mSize = RL_GetMonitorSize( monitor )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowSize( winSize )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
RL_SetWindowTitle( "Pong" )

View File

@@ -9,6 +9,7 @@ local function setupWindow()
local winSize = RL_GetWindowSize()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
end

View File

@@ -13,7 +13,7 @@ function utillib.deepCopy( orig )
copy = {}
for origKey, origValue in next, orig, nil do
-- If object has clone method use that. Mainly for vector libraries.
-- If object has clone method, use that.
if type( origValue ) == "table" and type( origValue.clone ) == "function" then
copy[ utillib.deepCopy( origKey ) ] = orig_value:clone()
else

View File

@@ -14,6 +14,7 @@ function init()
local winSize = RL_GetWindowSize()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
texture = RL_LoadTexture( RL_GetBasePath().."../resources/images/cat.png" )

View File

@@ -66,6 +66,7 @@ end
function init()
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowSize( winSize )
RL_SetWindowPosition( { monitorPos[1] + monitorSize[1] / 2 - winSize[1] / 2, monitorPos[2] + monitorSize[2] / 2 - winSize[2] / 2 } )
RL_SetWindowTitle( "Snake" )

View File

@@ -17,6 +17,7 @@ function init()
RL_SetWindowTitle( "Waving cubes" )
RL_SetWindowState( FLAG_WINDOW_RESIZABLE )
RL_SetWindowState( FLAG_VSYNC_HINT )
RL_SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } )
camera = RL_CreateCamera3D()

View File

@@ -5,6 +5,7 @@ local text = "Congrats! You created your first window!"
function init()
RL_SetWindowTitle( "First window" )
RL_SetWindowState( FLAG_VSYNC_HINT )
end
function process( delta )