Jump to content

Problem with screen resolution


grinseengel
 Share

Go to solution Solved by Admin,

Recommended Posts

Ok, I have the possibility to get a 4k resolution. I have a Gforce 1070.

In the script I find the following code:

"local gfxmode = System: GetGraphicsMode (System: CountGraphicsModes () - 1)
if System: GetProperty ("devmode") == "1" then
gfxmode.x = math.min (1280, gfxmode.x)
gfxmode.y = Math: Round (gfxmode.x * 9/16)
windowstyle = Window.Titlebar "

How can I change the resolution?

Greetings Andreas
Link to comment
Share on other sites

Here is the code that creates the window:

local gfxmode = System:GetGraphicsMode(System:CountGraphicsModes()-1)
if System:GetProperty("devmode")=="1" then
	gfxmode.x = math.min(1280,gfxmode.x)
	gfxmode.y = Math:Round(gfxmode.x * 9 / 16)
	windowstyle = Window.Titlebar
else
	gfxmode.x = System:GetProperty("screenwidth",gfxmode.x)
	gfxmode.y = System:GetProperty("screenheight",gfxmode.y)
	windowstyle = Window.Fullscreen
end
window = Window:Create(title,0,0,gfxmode.x,gfxmode.y,windowstyle)

It is set up so that when launched from the editor, it creates a smaller window. If launched alone, it creates a fullscreen window at maximum resolution. This is because you often need to go back and forth with the editor when you are working on a project.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Thank you for your prompt reply. However, this is exactly the script which is included in the 
tutorial level. My problem is that I can set in Editor mode and after the publish in the 
menu of the screen resolution max only 1280x 720 pixels. I can set a small resolution but 
none about it. Since my graphics card and my current games under 4k run I do not understand. 
Is it possibly the version of Lead Works?
Link to comment
Share on other sites

Quote

It is set up so that when launched from the editor, it creates a smaller window. If launched alone, it creates a fullscreen window at maximum resolution. This is because you often need to go back and forth with the editor when you are working on a project.

 

The resolution in the editor max 1280x 720 pixels is I understood. But I have even if the project is published only as a max. Resolution 1280x720 pixels.
A max resolution of 1920x1080 pixels I can not select as a standalone game.

What am I doing wrong?

 

 

Link to comment
Share on other sites

just select beta-latest build for testing  option and dont worry about code it not needed

it will start loading the beta after you come out of properties

 

 

Asus ROG STRIX B350-F GAMMING

AMD Ryzen 7 1700x

32 gb ddr4

15 TB raid 5 HD

Nvidia EVGA 1060GTX

Win10 64bit

Link to comment
Share on other sites

  • 4 weeks later...

I did notice something. Josh mentioned high DPI would make things small. There is a way around this and it comes down to how the individual leadwerks user writes their code. 

I will explain what I mean. Instead of using pixel sizes you want to use divisions of the screen size.

For example instead of saying

context:DrawImage(self.label, bx + (bsx / 2 ) - (150), by - 50, 300, 50)

you want it to look like this;

x = (context:GetWidth() - context:GetWidth())
y = (context:GetHeight() - context:GetHeight())
sx = (context:GetWidth() /10)
sy = (context:GetHeight() /20)

context:DrawImage(self.label, x, y, sx, sy)

I understand in these two examples the are different sizes and co-ordinates. But it is to just illustrate what I am referring to. Because if you make all your sizes based of screen size the same way you would with co-ordinates for printing, Everything you print to screen will always take up the same amount of screen size regardless of resolution.

You can't expect everything to resize if you don't first tell everything to resize.

So with this in mind I would like to see support for HIGH DPI. Because its really badly needed. And resizing is something that is easy for the programmer to implement into their project.

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...