Drawing Objects

V

Vladis

Guest
Hello. I have a problem with object that i have placed in room. When i am zooming in in the room object looks okay, but after i zoomed out the view object gets strange outlines and has a little displacement. Does anyone know how to solve this problem?

Thanks
 
What code are you using to zoom.

Make sure your final zoom factor is an integer value.

That's all I can think of without more details.

By the way, there are some good posts in the Tutorials section of the forum about scaling your game and avoiding issues like this.
 
V

Vladis

Guest
Thank you for answering, but the thing is that i have this problem in room editor. I don't have any zoom script which i use in game. When game is running object looks the same as in the room editor.
This object doesn't have any event.

Here are screenshots
Far.png

And now i zoomed in
near.png
 
In that case, you'll need to check your camera / room size / view port settings. Also, what options do you have set under graphics for scaling the game.

If the settings you have above don't scale evenly into the size of your display / monitor, you will get distortion. @RangerX and @Pixelated_Pope have good Tutorials on managing your screen size / resolution.

https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995/

https://forum.yoyogames.com/index.p...d-aspect-ratio-management-for-gms1-gms2.7106/
 
V

Vladis

Guest
Unfortunately, these lines do not disappear when game is running. I tried to change camera properties to 640x360 (before it was 1280x720) and viewport properties to 640x360(before it was 1280x720). So, these lines disappeared in running game. It depends on the distance from which I "look" at this area where these lines are. I've watched some threads and found the same issue, but it applies to tiles and there is no any solving of my problem in that thread.

https://forum.yoyogames.com/index.p...issue-between-tiles-seems-inconsistent.46422/

Thank you for trying to help me
 
Alright, so the best way to figure out what's going on here is to get all the information about your game's display properties. Here are two scripts:

Code:
/// @description display_write_spec(display enum)
/// @param DisplayEnum-screen/window/gui/app_surface/view

enum display{Screen, Window, Gui, AppSurface, View};
var str="";
switch(argument[0])
{
  case display.Screen:
    str="Display: "+string(display_get_width())+" x "+string(display_get_height())+" ("+string(display_get_width()/display_get_height())+")";
  break;
  case display.Window:
    str="Window: "+string(window_get_width())+" x "+string(window_get_height())+" ("+string(window_get_width()/window_get_height())+")";
  break;
  case display.Gui:
    str="GUI: "+string(display_get_gui_width())+" x "+string(display_get_gui_height())+" ("+string(display_get_gui_width()/display_get_gui_height())+")";
  break;
  case display.AppSurface:
    str="App Surface: "+string(surface_get_width(application_surface))+" x "+string(surface_get_height(application_surface))+" ("+string(surface_get_width(application_surface)/surface_get_height(application_surface))+")";
  break;
  case display.View:
    str="View: "+string(camera_get_view_width(view_camera[0]))+" x "+string(camera_get_view_height(view_camera[0]))+" ("+string(camera_get_view_width(view_camera[0])/camera_get_view_height(view_camera[0]))+")";
 break;
}
return str;
Code:
/// @description display_write_all_specs(x,y);
/// @param {real} x
/// @param {real} y
var _str="";
_str+=display_write_specs(display.Screen)+"\n";
_str+=display_write_specs(display.Window)+"\n";
_str+=display_write_specs(display.Gui)+"\n";
_str+=display_write_specs(display.AppSurface)+"\n";
_str+=display_write_specs(display.View)+"\n";
draw_text(argument0,argument1,_str);
Add those two scripts to your project, and then in some object's draw GUI event, run this code:
Code:
display_write_all_specs(5,5);
When you run your game, there should be a bunch of details about the camera and game window. Get us a screenshot with that info in it.
 
N

NeZvers

Guest
Small typo, @Pixelated_Pope.
Code:
/// @description display_write_all_specs(x,y);
/// @param {real} x
/// @param {real} y
var _str="";
_str+=display_write_spec(display.Screen)+"\n";
_str+=display_write_spec(display.Window)+"\n";
_str+=display_write_spec(display.Gui)+"\n";
_str+=display_write_spec(display.AppSurface)+"\n";
_str+=display_write_spec(display.View)+"\n";
draw_text(argument0,argument1,_str);
[?CODE]
 
Small typo @Pixelated_Pope
Code:
/// @description display_write_all_specs(x,y);
/// @param {real} x
/// @param {real} y
var _str="";
_str+=display_write_spec(display.Screen)+"\n";
_str+=display_write_spec(display.Window)+"\n";
_str+=display_write_spec(display.Gui)+"\n";
_str+=display_write_spec(display.AppSurface)+"\n";
_str+=display_write_spec(display.View)+"\n";
draw_text(argument0,argument1,_str);
[?CODE]
Ah. Thank you. I've shared these scripts dozens of times and nobody has pointed that out to me.
 
V

Vladis

Guest
Yes. I just choosed the area with black background in room to show details clearly
 
So your window/view/app surface/GUI are all 1280x768, but your display size is 1366 x 768

This means if you run the game full screen mode, the game is being stretched by a non-integer amount horizontally, unless you have the Keep Aspect Ratio option ticked in your graphics settings.

This will stretch the pixels unevenly, which causes the black lines is my guess, but I could be wrong. The reason I say I could be wrong is that you said you don't get the lines when you make your game 640x360, but this is also not evenly scaling into 1366x768.

Are running the game in full screen mode?

What happens if you run the game in windowed mode, do you still get the lines?

What are your graphics options settings?
 
They aren't in full screen, because the window would be the same size as the display if they were.

I don't see any reason why you'd be getting artifacts/lines between the objects at this point. Everything is the correct size/aspect ratio so there's no reason your GPU should be guessing about what color to put where.

Would you be willing to share your project so I can look at it? Send me a DM with the exported project file, and I'll take a look.
 
V

Vladis

Guest
Sorry, it is my fault. I understood how to deal with this line

Above the door.png

But the main problem are transperent lines. I changed camera's properties to some resolution before and i saw this line


Line.png

I don't remember what resolution was it, now this line is disappeared. But i can show you another example of transparent line

Transperent line.png

I downloaded the updated version of my project, so you can just run the game, make some move on "A" or "D" buttons and see that line.

Link :
https://drive.google.com/file/d/1a8J1zER_ZNaD4bwBUyQyb868egNTQR_2/view?usp=sharing

Thank you
 
Okay, do this for me. Get the lines to be visible, and also have that script I gave you drawing out all the view and window dimension stuff. Then we'll be able to tell you what your problem is most likely.
 
Top