Jump to content
  • 0
grinseengel

Problem with screen resolution

Question

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

Share this post


Link to post

24 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
  • 0
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?

Share this post


Link to post
  • 0

Leadwerks 4 does not support high DPI resolutions because it would make the GUI tiny.

Share this post


Link to post
  • 0
Ok, then is the max resolution at 1280x720 pixels? Or is there a way with Leaswerks also projects 
with higher resolution to create?

Share this post


Link to post
  • 0

It's dependent on your monitor resolution and DPI. What is your monitor resolution, and is it a high DPI monitor?

Share this post


Link to post
  • 0
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?

 

 

Share this post


Link to post
  • 0
Ok, that's what I did.

1) Project loaded
2) Publish project
3) Leadwerk finished
4) Project started from hard disk
5) max. Resolution = 1280x720 pixels in full screen
6) a higher resolution is not possible

Share this post


Link to post
  • 0

are you on the latest beta. as josh did fix a screen bug in that 

 

  • Thanks 1

Share this post


Link to post
  • 0

You can install the 4.6 beta, update your project, and see if that fixes the issue. If not I suggest uploading an example here so we can all try it.

 

Share this post


Link to post
  • 0

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

 

 

Share this post


Link to post
  • 0
I now have the version 4.6 installed. However, my problem has not changed.

I can not get beyond a resolution of 1280x720 pixels.

Can it be because I do not use a monitor but a TV device?

Share this post


Link to post
  • 0

I doubt it. What is the display scaling factor in Windows display properties?

Please upload an example we can run.

Share this post


Link to post
  • 0
The scales in Windows, I've tried all three.

1) aspect ratio
2) Full screen
3) no scaling

All settings have not changed the appearance.

I have uploaded a start level.

test1.rar

Share this post


Link to post
  • 0
Thanks alot.

It works now.....

A question about Leadwerk 5. Is the version already available and is it supported 4k?

 

 

Share this post


Link to post
  • 0

Yes, Leadwerks 5 will support high DPI monitors. The GUI will scale to fit the DPI.

Share this post


Link to post
  • 0

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

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

×
×
  • Create New...