Jump to content

Leadwerks windowed to fullscreen


Leigh
 Share

Recommended Posts

I'm sure this topic has been covered before, but I'm new at scripting and have just been tinkering and messing around with various things to see what happens and I have no real knowledge of scripting. While I have managed to change the resolution parameters in the Main.lue script to something more suitable, the game still runs in windowed mode instead of fullscreen. What parameter do I change to get a game to run fullscreen?

 

--Initialize Steamworks (optional)

Steamworks:Initialize()

--Set the application title

title="sci fi shooter"

--Create a window

local windowstyle = window.Titlebar

if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end

window=Window:Create(title,0,0,System:GetProperty("screenwidth","1920"),System:GetProperty("screenheight","1080"),windowstyle)

window:HideMouse()

--Create the graphics context

context=Context:Create(window,0)

if context==nil then return end

--Create a world

world=World:Create()

world:SetLightQuality((System:GetProperty("lightquality","1")))

--Load a map

local mapfile = System:GetProperty("map","Maps/CryoLab.map")

if Map:Load(mapfile)==false then return end

 

while window:KeyDown(Key.Escape)==false do

 

--If window has been closed, end the program

if window:Closed() then break end

 

--Handle map change

if changemapname~=nil then

 

--Clear all entities

world:Clear()

 

--Load the next map

Time:Pause()

if Map:Load("Maps/"..changemapname..".map")==false then return end

Time:Resume()

 

changemapname = nil

end

 

--Update the app timing

Time:Update()

 

--Update the world

world:Update()

 

--Render the world

world:Render()

 

--Render statistics

context:SetBlendMode(Blend.Alpha)

if DEBUG then

context:SetColor(1,0,0,1)

context:DrawText("Debug Mode",2,2)

context:SetColor(1,1,1,1)

context:DrawStats(2,22)

context:SetBlendMode(Blend.Solid)

else

--Toggle statistics on and off

if (window:KeyHit(Key.F11)) then showstats = not showstats end

if showstats then

context:SetColor(1,1,1,1)

context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2)

end

end

 

--Refresh the screen

context:Sync(true)

 

end

Main.lua

Link to comment
Share on other sites

I use this:

 

--Create a window

local windowstyle = window.FullScreen

if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end

window=Window:Create(title,0,0,System:GetProperty("screenwidth","1920"),System:GetProperty("screenheight","1080"),windowstyle)

window:HideMouse()

 

Hope this helps.

Link to comment
Share on other sites

on this line:

if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end

 

Try removing the "windowstyle+" before the "window.FullScreen" part (so make it windowstyle=window.FullScreen).

 

Also make sure System:GetProperty("fullscreen") is gives you "1". ;)

Using Leadwerks Professional Edition (Beta), mainly using C++.

Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz

Previously known as Evayr.

Link to comment
Share on other sites

I use this:

 

--Create a window

local windowstyle = window.FullScreen

if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end

window=Window:Create(title,0,0,System:GetProperty("screenwidth","1920"),System:GetProperty("screenheight","1080"),windowstyle)

window:HideMouse()

 

This is what I already tried but all it does is give me a script error message

 

 

 

Try removing the "windowstyle+" before the "window.FullScreen" part (so make it windowstyle=window.FullScreen).

 

I did as you suggested but it makes no difference for me. It still runs in a window, even if I change the resolution. Is there something else I have to do?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...