Discussion in 'Tutorials' started by Pixelated_Pope, Sep 12, 2016.
Great tutorial! I am having one issue though. For some reason it is drawing a black bar at the top of screen, but doesn't do it if I comment out the pixel perfect portion of the script.
I'm using the GMS 2 version of the tutorial, have checked the code multiple times, but can't seem to figure out what might be causing it. My ideal height is set to 540 with my room sizes at 960x540.
I don't recommend using the pixel perfect scaling... but that said, it certainly shouldn't give you black bars. What's the resolution of your monitor?
1920x1200. There is only one bar at the top of the screen (rather than one at bottom and top). Not sure why turning it off is fixing it either.
I'll keep it turned off then!
Ah, because your room isn't tall enough! When you scale it to be pixel perfect, it will scale the height to be perfect. 540 doesn't go perfectly into 1200, so it resizes your view to be 600 tall. Your rooms are only 540 tall, so you see the outside of your room, which is black.
Ah that makes sense! Thanks again for your help. Great series - really appreciated the lead-up videos explaining the background of the topic and laying the groundwork for the system.
Sorry for another question so soon, but I'm now having an issue where the text I draw is getting distorted (I think only in fullscreen mode). I did a check and my camera width/height are running at 864x540.
My rooms are 960x540, my ideal height is set to 540, and my computer resolution is 1920x1200.
Are you drawing your text in a gui event? When you are in full screen, do you have black bars at the top and bottom (you shouldn't)?
No black bars. Seems to be an issue in both Draw and Draw GUI events.
So, the only time there should ever be distortion is when aspect ratios don't match. Specifically your view and your application surface. Here's a script I use to debug all this.
Add those two scripts to your project, and then in your draw_gui event somewhere write:
The numbers in the parentheses is your aspect ratio for that element. All of those numbers should be the same. If not, there's a chance for distortion. So that should give you an idea where to look. If you still can't figure it out, send me a screenshot, and I'll be happy to help you.
Also, just FYI, you can join my Discord server where hundreds of awesome GM developers hang out and help each other. It's a great way to get programming help without the waiting for forum post responses, and I'm there 5 days a week along with many very skilled and helpful developers. https://discord.gg/sehNsp
Thank you for the scripts. I ran it, but it looks like they are all the same number. Here is a screenshot showing it. The issue is also definitely not the font either as when I run the game without the scaling system it looks great. I'm on the discord as well too!
@IndieRex That is indeed weird. The only thing I can really think of is that there is some sort of pixel interpolation going on. Do you have that setting turned on? Even then, it looks weird. If you'd be willing, you could PM me your project and I'll see if I can figure out what's going on.
This tutorial is the gift that keeps on giving for years now lol.