• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Let the game not use sub-pixels

TrunX

Member
To make sure that the application surface and the GUI don't make use of sub-pixels in my pixel art game I execute the following code at the beginning of the game:
Code:
surface_resize(application_surface, view_wview,view_hview);
display_set_gui_size(view_wview,view_hview);
While it works for sprites and text in both Draw Events, the draw_geometry functions (line, circle, triangle) use always the finer screen resolution in the Draw GUI Event.
In the normal Draw Event these functions use the game resolution instead of the screen resolution.

Is this intended or a bug?
 

TrunX

Member
I've just found out that scaling text and sprites inside the Draw GUI Event makes also use of sub-pixels.
So I assume it's not a bug but the line display_set_gui_size(view_wview,view_hview) doesn't do what I've assumed it would do?

Is there a simple solution to render everything in the GUI-Event in the desired resolution?

For the normal draw event surface_resize(application_surface, view_wview,view_hview) does the job.
 
W

Wayfarer

Guest
While it works for sprites and text in both Draw Events, the draw_geometry functions (line, circle, triangle) use always the finer screen resolution in the Draw GUI Event.
In the normal Draw Event these functions use the game resolution instead of the screen resolution.
That sounds really familiar - though I'm not using GMS1 anymore. Even still, I'm certain there was a way to solve it.

Turn off 'Interpolation between pixels'?
Pretty sure changing the interpolation won't fix this. When the game is scaled say 4x, the subpixels are the 4 pixels that make up each single "non-scaled" pixel. Obviously technically the subpixels are actually just pixels once the game is scaled :p

(I think you know this already - just typing it out anyway)

---
Edit:
Have you tried setting "display_set_gui_size" to some random values like "display_set_gui_size(100, 50)"? What about setting it at the start of the GUI event in the case that you've set it somewhere else in your game?
 
Last edited:
L

Lonewolff

Guest
Pretty sure changing the interpolation won't fix this. When the game is scaled say 4x, the subpixels are the 4 pixels that make up each single "non-scaled" pixel. Obviously technically the subpixels are actually just pixels once the game is scaled :p
Wut? o_O

Pretty sure that's not what "sub-pixel's" are.
 
W

Wayfarer

Guest
Wut? o_O
Pretty sure that's not what "sub-pixel's" are.
You may be right on the meaning of the word "sub-pixels" itself, though I think what the OP means is the extra pixels created from scaling. Perhaps that has another name?!
I've always incorrectly been calling them "subpixels".

Edit:
My bad, reading the proper definition for subpixels now. Though I still don't know the word used to describe what the OP is saying.
Edit2: While looking up the definition I also come across blogs using the word "subpixel" incorrectly how I used it too.
 
Last edited:

TrunX

Member
Yes I mean the full single pixels of a monitor when scaling a pixel art game so each pixel of the game uses multiple pixels of the monitor.
Please enlighten me how they are called correctly. ;)

Resizing the application surface solves the problem regarding scaling, rotation and "sub-pixel" movement for the normal draw event.
Resizing the GUI solves only the problem for "normal" draw functions. Everything else like rotation, scaling and the draw_geometry-functions still make use of the finer resolution.
 
Top