Premium Only Content
							This video is only available to Rumble Premium subscribers. Subscribe to
							enjoy exclusive content and ad-free viewing.
					
								
			Stay Down Dev Log - Part 10 - Fit Canvas To Window
								4 years ago							
						
														28						
								
								
												frank poth					
								
												html5					
								
												js					
								
												css					
								
												javascript					
								
												html5 game					
								
												programming tutorial					
								
												pothonprogramming					
								
												learn programming					
								
												programming					
								
												code					
					
					
			
	
					Hey, everybody! If you are looking for a tutorial on how to make your game's display canvas scale to fit the window without breaking its aspect ratio you have come to the right place. In addition to lots of code refactoring I'll be adding this functionality to my 2D game project. I'm using HTML5 and JS, but you could use the same logic in any application to make one rectangle scale to fit inside another.
What you'll see in this video:
00:00:45 - Refactoring the global object
00:03:45 - Refactoring the Game States
00:19:00 - Resizing the display canvas
00:24:00 - Testing it out
Thanks for watching! Check out the site! https://pothonprogramming.github.io
Loading  comments...				
			
		- 	
				
							17:39
								Poth On Programming
4 years agoStay Down Dev Log - Part 9 - Destructuring Objects
21 - 	
				
							56:52
								Poth On Programming
4 years agoStay Down Dev Log - Part 14 - Background Graphics!
20 - 	
				
							50:45
								Poth On Programming
4 years agoStay Down Dev Log - Part 15 - Custom Text Graphics
46 - 	
				
							47:58
								Poth On Programming
4 years agoStay Down Dev Log - Part 1 - Gravity, Friction, Hit The Ground!
84 - 	
				
							0:26
								Colinborg96
4 years agoSealing window part 1
64 - 	
				
							1:59
								307 Gaming
4 years agoWindow Beat Down
5 - 	
				
							29:04
								Poth On Programming
4 years agoStay Down Dev Log - Part 2 - Keyboard Controls, Running and Jumping!
44 - 	
				
							8:15
								Pixel
4 years ago $0.01 earnedSpace Game Part 33 - Character Window!
62 - 	
				
							0:17
								ViralHog
6 years agoMuffler Tied Down Through Car Window
481 - 	
				
							3:41
								KMTV
5 years agoTearing down the old broken window syndrome
25