Getting Started with Screen Sizes in Godot 3

  Рет қаралды 90,148

GDQuest

GDQuest

6 жыл бұрын

Make your Godot 3 game adapt to different screen sizes with this tutorial! It's Guilherme's first video on the channel.
He made a Godot course for beginners on Udemy: bit.ly/guis-godot-course
----
LINKS
Godot 3 project on GitHub: bit.ly/screen-sizes-demo-godot-3
Godot 3 course: gdquest.mavenseed.com/courses
This video is supported by:
- Gamblify: www.gamblify.com/
- Pineapple Works: pineapple.works/
- Echo86: www.echo86.com/
Subscribe for more tutorials! kzbin.info?sub_con...
Twitter ► / nathangdquest
Instagram ► / prepare
This video is licensed under the CC-By 4.0 license: creativecommons.org/licenses/...
You can attribute it to "GDQuest and contributors - www.gdquest.com/"

Пікірлер: 76
@Gdquest
@Gdquest 6 жыл бұрын
It's Guilherme's first time on the channel. What do you think? He's really open to feedback so he'll be glad to see your replies. And please ask any questions you may have about this topic! He also has a Godot course on Udemy, made for beginners: bit.ly/guis-godot-course Regarding screen sizes now. For one it's an issue we all face as game developers as not only mobile, but computer and TV displays come in different shapes and sizes. Your game and UI doesn't need to scale in realtime like a responsive website, but it does need to adapt to different screens. This means that different players will have a slightly different view of the game. It's important to keep in mind when you create cut-scenes or design challenges as someone with a wider screen might see something they shouldn't. If you're looking for a rule of thumb to pick the right project settings, you can give the 2d mode and expand aspect ratio a try. Expand will smartly expand on the axis that stretches past the game's base aspect ratio. The one that goes with its resolution.
@SilenceStabber
@SilenceStabber 6 жыл бұрын
goooood
@lukostello
@lukostello 3 жыл бұрын
I'm so glad I watched this, I might not have ever looked in the project settings and tried to effectively implement the 2d stretch mode using code for my control nodes
@evanhardin
@evanhardin 6 жыл бұрын
This video was super useful. Thanks!
@eduardosanchezbarrios5810
@eduardosanchezbarrios5810 6 жыл бұрын
I agree
@laurencebannister
@laurencebannister 6 жыл бұрын
Thank you so much for this. Loved it!
@AntonioMarcodaSilva_antomarsi
@AntonioMarcodaSilva_antomarsi 6 жыл бұрын
Wow, a Brazilian, nice
@SaladinoPrince1
@SaladinoPrince1 4 жыл бұрын
iiieeeeiii
@IgorogI1000
@IgorogI1000 4 жыл бұрын
hihih é nois
@wuubixz
@wuubixz 3 жыл бұрын
Ihu
@thiagooliveira7935
@thiagooliveira7935 3 жыл бұрын
i think all of them in this channel are ...
@guustavols
@guustavols 3 жыл бұрын
@@IgorogI1000 kkkkkkkkkkkkkkkkkk
@antanaspaskauskas9432
@antanaspaskauskas9432 5 жыл бұрын
Do you know what does option Shrink actually do? Does it reduce internal / rendered resolution or output displayed resolution?
@Bright-Fall
@Bright-Fall 6 ай бұрын
BRAVO! I am so happy this fixed my games fullscreen issue you are a hero of the people gentlemen
@Blodyx_
@Blodyx_ 2 жыл бұрын
This is exactly what i needed, thank you!
@tonywithani
@tonywithani 5 жыл бұрын
Nice tut. Really helpful.
@GoodCraftingYT
@GoodCraftingYT 3 жыл бұрын
THANK YOU SO MUCH!!! YOU HAVE NO IDEA HOW MUCH YOU HELPED ME!
@user-ti1ji9di6n
@user-ti1ji9di6n 2 ай бұрын
Thank you so much..this video was really helpful
@dheatlyblaze2846
@dheatlyblaze2846 Жыл бұрын
This is very helpful! Thank you!
@raventhorX
@raventhorX 5 жыл бұрын
But what if you wanted to adjust the viewport size? I am using a tilemap and everything looks to small for what I want it to be for my start screen, however I can't adjust the size of everything in one go and would have to go back through the tilemap to re adjust it's size, a simple fix to this for me is zooming the view in a bit to make everything appear bigger and the only way I can think of to do this is to reduce the size of the viewport but idk how.
@Sfr047
@Sfr047 Жыл бұрын
I thought about how to do it for 3 days and you helped me even though this video is old, but it helped me thanks! :)
@joeyallard
@joeyallard 5 жыл бұрын
Very helpful video! Thank you :)
@nomoremuda
@nomoremuda 2 жыл бұрын
Best explanation of this I’ve seen
@sirbootylord6880
@sirbootylord6880 2 жыл бұрын
Simpler than I thought it would be, thank you gents
@Lu_Ciel.
@Lu_Ciel. 4 жыл бұрын
Hello. Is it possible to force Godot to only scale the window based on integer steps? eg: i have a window with width = 480 pixels, so, the next allowed size is width = 960 pixels? Thank you
@thomaswmedeiros9906
@thomaswmedeiros9906 Жыл бұрын
Omg, thank you so much
@kolts2026
@kolts2026 11 ай бұрын
thanks it worked
@zanyman
@zanyman 3 жыл бұрын
THANKS FOR SOLVING MY PROBLEM
@thecringeybatboy491
@thecringeybatboy491 3 жыл бұрын
thx this helped alot
@cyberground.
@cyberground. 6 жыл бұрын
Thanks, that help me for a GameJam ;)
@helkat9876
@helkat9876 5 жыл бұрын
i have a question, i am making a game that allows player to turn on full screen mode, but it should allow to turn it off too. and here is the problem , i can't write a code that turns off full screen, can u help me?
@dynomitediamond6296
@dynomitediamond6296 4 жыл бұрын
Running "OS.window_fullscreen = !OS.window_fullscreen" allows you to toggle fullscreen. To turn it off, try OS.window_fullscreen = false
@bitmammothOG
@bitmammothOG 4 жыл бұрын
Thank You :)
@maviberelibalikci
@maviberelibalikci 2 жыл бұрын
thx bro
@auto-fav8969
@auto-fav8969 2 жыл бұрын
thanks great
@user-js7ud9du2y
@user-js7ud9du2y Жыл бұрын
unity lacks this black bar feature. though i think the resizable screen should have draggable corners instead
@Rin-qj7zt
@Rin-qj7zt 2 жыл бұрын
i don't understand. my game isn't doing this. it's squishing and squashing text into unreadability when scaled. buttons become unreasonably thin, and i can't figure out how to force them to remain constant like your buttons do.
2 жыл бұрын
thanks
@fernandev7879
@fernandev7879 2 жыл бұрын
top guilhermão!
@MrTomas7777
@MrTomas7777 4 жыл бұрын
What if I want "expand" aspect mode but expanding to both sides instead of anchoring the viewport to top-left?
@PROJECTJoza100
@PROJECTJoza100 4 жыл бұрын
This is exactly what i need and ive been looking for it for hours... Have you found the solution to share?
@MrTomas7777
@MrTomas7777 4 жыл бұрын
PROJECT: Joza100 Nope... :/
@PROJECTJoza100
@PROJECTJoza100 4 жыл бұрын
@@MrTomas7777 i figured it out. I posed on reddit but then fogured it out and the solution is in the comments. www.reddit.com/r/godot/comments/f39u4w/how_to_use_keep_height_and_show_more_of_left_and/?
@MrTomas7777
@MrTomas7777 4 жыл бұрын
Oh nice, thanks 👍
@brucelee7782
@brucelee7782 6 ай бұрын
Should we just design in a 1920x1080 window size so that it looks good for smaller screen sizes? There's too many options it's confusing
@matthewnewsom5225
@matthewnewsom5225 5 жыл бұрын
So I want to create a 64x64 pixel game, so that's the widht/height set in project setttings. But that means the game window is hellllla small. I can enable stretching so the user can make it bigger, but how can I actually set the default window size to something bigger than 64 pixels?
@Gdquest
@Gdquest 5 жыл бұрын
There should be some function in the OS class. Also for testing check the 'test resolution' project settings
@channelnumber52
@channelnumber52 5 жыл бұрын
You don't want a 64 x 64 pixel game. You want to create a screen with a height and width of 64 units. Each unit will be multiple pixels. I'm much more familiar with how to do this in LibGDX, not Godot, so I can't tell you how to achieve this. Try creating a tilemap that is 64 by 64, and then configure your camera to fit that tilemap on screen properly, then boom, you've got your camera set to a 64x64 world.
@shinobiinu6920
@shinobiinu6920 4 жыл бұрын
Hello! Does this method make games also mobile optimized automatically?
@tuxuni2587
@tuxuni2587 4 жыл бұрын
Theoretically yes, it does.
@rsensato
@rsensato 6 жыл бұрын
Massa!
@Hana_UwU
@Hana_UwU 2 жыл бұрын
nice
@user-zx2wv4ej2s
@user-zx2wv4ej2s 3 жыл бұрын
what code in TouchBu..??
@Zen-rw2fz
@Zen-rw2fz 4 жыл бұрын
you two are different persons? I thought you were just nathan with a younger voice in your older videos
@dredan88
@dredan88 Жыл бұрын
BRASIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIILLLLLLL
@Chevifier
@Chevifier 3 жыл бұрын
Best bet is to target 16:9. Aspect ratio and set it to keep
@bucherregaldomi9084
@bucherregaldomi9084 2 жыл бұрын
sixteenine noice
@doniyorkoshimbetov3729
@doniyorkoshimbetov3729 4 жыл бұрын
I cant see the difference between 2d and viewport. Can anybody explain, pleasae
@IndividualFreedomNet
@IndividualFreedomNet 3 жыл бұрын
It confused me too in the beginning and it is not very well explained here. Both deal differently with the original resolution as defined in the project settings in relation to the resolution of the game running on the actual device. For my explanation let's assume you define a base resolution of 960 x 640 in the project settings (the native resolution of an iPhone 4S for example). Then you run it on that iPhone 4S, a Samsung S7 at 2560 x 1440 and on a PC/Mac desktop running at fullscreen in full HD 1920 x 1080. Let's also assume the game is a 2D game and mainly has several 2D graphics displaying sprites and such, but also draws a HUD on top of it with text and some "vector graphics" like diagonal lines. Now what happens is as follows: "Viewport" renders the game internally at exactly the resolution which you define in the settings (for everything: graphics, text and vector drawing) and then stretches the result to the target resolutions. On the 4S it will look exactly as designed in all aspects (no stretching happens). Both on the S7 and on the desktop versions the 960 x 640 will be scaled up to 2560 x 1440 and 1920 x 1080 respectively. Everything will look scaled up equally, the graphics will probably look good, but the text and vector drawings will probably look a bit uglier than they could and blurry along the edges. "2D" on the other hand, renders your game at the target resolution of the device internally - and NOT what you set in the project settings (but the aspect ratio will be kept if you chose the according setting). So for the 4S there will be no difference at all to "Viewport" - every single pixel will be identical. But for the other devices it renders into a much larger viewport: 2560 x 1440 for the S7 and 1920 x 1080 for the desktop versions. The scaled up sprites and background graphics will probably look the same like with "Viewport", but the text and vector graphics output will be drawn at the higher resolution directly and look much sharper and less blurry with "2D". The larger the difference between the base resolution and the target resolution is, the more you will see the difference. In conclusion, generally "2D" is the better choice for most use cases as the result of graphics/sprites are pretty much the same in both cases, but text and vector drawings look a lot better with "2D". But "2D" also needs more performance to be drawn, so "Viewport" sometimes might be a performance related choice. If you have a "pixel look" game (which you want to use for text/drawing too), you might prefer "Viewport" for aesthetic reasons. PS: Note that if a target device has a smaller resolution than what you define in the project settings, "Viewport" will need more performance and actually scale down. "2D" on the other hand will draw to that smaller resolution directly. (But this is probably a rare case unless you design your game in a kind of "middle resolution"...) Probably my explanation would have been more precise (but also more confusing) if I chose a "middle resolution" (full HD) as the base and made an example with a smaller (4S) and one with a larger resolution (S7). But I hope you get this idea... :-)
@doniyorkoshimbetov3729
@doniyorkoshimbetov3729 3 жыл бұрын
@@IndividualFreedomNet Thank you a lot. Now I understand
@mamaeluigi2532
@mamaeluigi2532 4 жыл бұрын
BRASIL CAMPEÃO DO MUNDO!
@Arkl1te
@Arkl1te 3 жыл бұрын
Note to myself: Mode -> 2d Aspect -> keep
@twl148
@twl148 4 жыл бұрын
thank you kanYE
@peeleandro
@peeleandro 2 жыл бұрын
Brasileiro ?????? TOP
@forhadrh
@forhadrh 3 жыл бұрын
👍
@jrumiak
@jrumiak 6 жыл бұрын
Sadly I must say that I'm a bit disappointed... A couple of points to work on: - Slow down. Please :) - Do not show only the API. It's meant as a tutorial. Tell me more about why and when I should use it. - Switching to Viewport makes things more pixelated... alright... but why? Please explain. It's described better even in original docs: docs.godotengine.org/en/3.0/tutorials/viewports/multiple_resolutions.html#doc-multiple-resolutions - Stretch modes - more or less the same as above. Slow down, explain, add meaningful examples. - Expand mode - if something is "tricky" to use, this is probably the part you should focus on more instead of rushing thrue it. Also don't say "you don't know what is going to happen". You are making this video exactly for this propose - to tell me what is going to happen. Again, it is described in the docs. - What happened to "Shrink" option? Why it's left out? Overall: Good start. Keep up good work but there is still room for improvement. Take a look at this: kzbin.info/aero/PLXkVsacazW2qvdnKNzgBLkUwlgi3FU-VO
@Gdquest
@Gdquest 6 жыл бұрын
Agreed, thanks much for the constructive feedback! I gave a lot to Guilherme already, sent him your comment as well. He has a great attitude so you should see his content improve quickly :)
@oito20
@oito20 6 жыл бұрын
Eu queria que a godot tivesse uma comunidade brasileira como tem a unity. Vejo que muita gente tá passando a usar ela, porém é muito mais difícil tirar dúvidas.
@somarandtheastronautape6518
@somarandtheastronautape6518 5 жыл бұрын
Sei que posso parecer ignorante, mas inglês no mundo de desenvolvimento de jogos é o mínimo que você pode aprender. Depois, o Discord do Godot é extremamente útil, tem diversas pessoas lá, inclusive o próprio GDquest está sempre lá tirando a dúvida de todos. Desde que comecei a usar o Godot(e sou muito amador ainda) tiro todas as minhas dúvidas lá. E já estou próximo de terminar meu primeiro projeto.
@marcelogamer2156
@marcelogamer2156 3 жыл бұрын
Eaí Guilherme! Bora Brasil!!!
@srlilith7167
@srlilith7167 3 жыл бұрын
ta na cara que é BR kkkk, mas ótimo vídeo, vlw adorei seu inglês
@kramgamedev995
@kramgamedev995 5 жыл бұрын
seria interessante se houvesse pelo menos uma legenda em pt parabens pelo video
@WolfsDenShop
@WolfsDenShop 4 жыл бұрын
You have to slow down a little, you're like a 'Machine Gun.' Your accent's nice, so don't worry about that.
@KidoKatsuragi
@KidoKatsuragi 3 жыл бұрын
Video was useless. Nothing more than overview of settings without any real use cases.
Seven Minutes to Decide On Godot 4 in 2024
7:36
GDQuest
Рет қаралды 158 М.
Godot Recipes: Animation States
10:31
KidsCanCode
Рет қаралды 105 М.
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 59 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 52 МЛН
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 6 МЛН
Using the Tileset Editor in Godot 3.1 (tutorial)
19:34
GDQuest
Рет қаралды 224 М.
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
DevLogLogan
Рет қаралды 493 М.
Make Your Own Raycaster Part 1
16:52
3DSage
Рет қаралды 409 М.
10+2 AWESOME ADDONS for GODOT 4
8:36
MrElipteach
Рет қаралды 131 М.
How I Started Making Games with No Experience
9:49
Vimlark
Рет қаралды 1,9 МЛН
Create a Game Interface From Scratch in Godot 3 (tutorial)
34:09
I Made the Same Game in 9 Engines
16:12
Emeral
Рет қаралды 273 М.
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 325 М.
How I made an Excellent Platformer
8:25
GoldenEvolution
Рет қаралды 262 М.