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 17:39Poth On Programming4 years agoStay Down Dev Log - Part 9 - Destructuring Objects21
- 	
				 56:52 56:52Poth On Programming4 years agoStay Down Dev Log - Part 14 - Background Graphics!20
- 	
				 50:45 50:45Poth On Programming4 years agoStay Down Dev Log - Part 15 - Custom Text Graphics46
- 	
				 47:58 47:58Poth On Programming4 years agoStay Down Dev Log - Part 1 - Gravity, Friction, Hit The Ground!84
- 	
				 0:26 0:26Colinborg964 years agoSealing window part 164
- 	
				 1:59 1:59307 Gaming4 years agoWindow Beat Down5
- 	
				 29:04 29:04Poth On Programming4 years agoStay Down Dev Log - Part 2 - Keyboard Controls, Running and Jumping!44
- 	
				 8:15 8:15Pixel4 years ago $0.01 earnedSpace Game Part 33 - Character Window!62
- 	
				 0:17 0:17ViralHog6 years agoMuffler Tied Down Through Car Window481
- 	
				 3:41 3:41KMTV5 years agoTearing down the old broken window syndrome25