User Tools

Site Tools


en:guides:beginners:viewport_and_camera

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:guides:beginners:viewport_and_camera [2020/08/19 12:15 (5 years ago)] – Viewport -> MainViewport to match the changes in init's template iarwainen:guides:beginners:viewport_and_camera [2024/11/17 02:31 (5 months ago)] (current) – Fixes and alignment to newer orx. sausage
Line 14: Line 14:
 Let's give our game a blue sky as a background, by adding the ''BackgroundColor'' property to the config: Let's give our game a blue sky as a background, by adding the ''BackgroundColor'' property to the config:
  
-<code=ini>+<code=ini [highlight_lines_extra="3"]>
 [MainViewport] [MainViewport]
 Camera            = MainCamera Camera            = MainCamera
Line 35: Line 35:
 Let's change the screen width and height so that it makes working through the tutorial easier (and easier to take screenshots :) ): Let's change the screen width and height so that it makes working through the tutorial easier (and easier to take screenshots :) ):
  
-<code=ini>+<code=ini [highlight_lines_extra="2,3"]>
 [MainCamera] [MainCamera]
 FrustumWidth    = 800 FrustumWidth    = 800
Line 44: Line 44:
 </code> </code>
  
-A frustum width and height does not have to be the same size as your screen, but for our game, we want it to be. So the ''ScreenWidth'' and ''ScreenHeight'' values from the ''[Display]'' section are being inherited from the ''FrustumWidth'' and ''FrustumHeight'' values, as you can see at:+A frustum width and height does not have to be the same size as your screen, but for our game, we want it to be. So the ''ScreenWidth'' and ''ScreenHeight'' values can be added to the ''[Display]'' section and are being inherited from the ''FrustumWidth'' and ''FrustumHeight'' values:
  
 <code ini> <code ini>
Line 69: Line 69:
 Because the camera was specified in the ''[MainViewport]'' section, we do not need to create a camera in code. Because the camera was specified in the ''[MainViewport]'' section, we do not need to create a camera in code.
  
-Final thing for this step is to name our game. This name will show in the window title. Set this with the ''Title'' property in the ''[Display]'' section. Also while you are here, set the ''Smoothing'' to false:+Final thing for this step is to name our game. This name will show in the window title. Set this with the ''Title'' property in the ''[Display]'' section. Also while you are here, set the ''Smoothing'' to false, and Decoration to true which means to make a standard window:
  
-<code=ini>+<code=ini [highlight_lines_extra="4,6,7"]>
 [Display] [Display]
 ScreenWidth     = @MainCamera.FrustumWidth ScreenWidth     = @MainCamera.FrustumWidth
Line 77: Line 77:
 Title           = Platform Hero Title           = Platform Hero
 FullScreen      = false FullScreen      = false
 +Decoration      = true
 Smoothing       = false Smoothing       = false
 VSync           = true VSync           = true
Line 86: Line 87:
 [Display] [Display]
 Title           = Platform Hero (Debug) Title           = Platform Hero (Debug)
-ShowFPS         = true 
 </code> </code>
  
en/guides/beginners/viewport_and_camera.1597864534.txt.gz · Last modified: 2020/08/19 12:15 (5 years ago) by iarwain