1 / 12

Outline 8.1 Sprite Font 8.2 Type of Scrolling Background 8.3 Tile-based Scrolling Background

MTA-4201 Game Programming Chapter 8 : Scrolling Background & Font. Outline 8.1 Sprite Font 8.2 Type of Scrolling Background 8.3 Tile-based Scrolling Background 8.4 2D Camera Movement 8.5 2.5D Isometric Map. 8.1 Sprite Font. There are Three ways to output text in XNA games:

wing-burns
Download Presentation

Outline 8.1 Sprite Font 8.2 Type of Scrolling Background 8.3 Tile-based Scrolling Background

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MTA-4201 Game ProgrammingChapter 8 : Scrolling Background & Font Outline 8.1 Sprite Font 8.2 Type of Scrolling Background 8.3 Tile-based Scrolling Background 8.4 2D Camera Movement 8.5 2.5D Isometric Map

  2. 8.1 Sprite Font There are Three ways to output text in XNA games: • Xml based spritefont (For English) To draw text on screen : http://msdn.microsoft.com/en-us/library/bb447673.aspx

  3. 8.1 Sprite Font The following list of fonts are installed by XNA Game Studio and are redistributable: • Kooten.ttf, Linds.ttf, Miramo.ttf, Bold Miramob.ttf, Peric.ttf, Pericl.ttf, Pesca.ttf, Pescab.ttf

  4. 8.1 Sprite Font

  5. (2) Bitmap Font (For English) (3) Customized Content Pipeline (For Asian Language) http://msdn.microsoft.com/en-us/library/bb447751.aspx

  6. 8.2 Types of Scrolling Background Scrolling Background games allow game Developers to present a much larger world To the game player because things could Be outside of the view of the immediate game Screen. Layers of scrolling backgrounds to Improve the quality of the game screens. (1) Side-Scrolling Background (2) Vertical-Scrolling Background (3) Parallax-Scrolling Background

  7. 8.3 Horizontal / Vertical Scrolling • In the project, add the images, and the library files : Sprite.cs and HorizontallyScrollingBackground.cs . (2) Add the new variable //Create a Horizontally scrolling background HorizontallyScrollingBackgroundmScrollingBackground; (3) Modify the LoadContent() method to look like this. protected override void LoadContent() { mScrollingBackground = newHorizontallyScrollingBackground(this.GraphicsDevice.Viewport); mScrollingBackground.AddBackground("Background01"); mScrollingBackground.AddBackground("Background02"); mScrollingBackground.AddBackground("Background03"); mScrollingBackground.AddBackground("Background04"); mScrollingBackground.AddBackground("Background05"); //Load the content for the Scrolling background mScrollingBackground.LoadContent(this.Content); }

  8. 8.3 Horizontal Scrolling (4) Modify the Update() method to look like this. protected override void Update(GameTime gameTime) { //Update the scrolling backround. mScrollingBackground.Update(gameTime, 160,HorizontallyScrollingBackground.HorizontalScrollDirection.Left); } (5) Modify the Draw() method to look like this. protected override void Update(GameTime gameTime) { spriteBatch.Begin(); //Draw the scrolling background mScrollingBackground.Draw(spriteBatch); spriteBatch.End(); } Detailed Explanation of Horizontal Scrolling : http://www.xnadevelopment.com/tutorials/scrollinga2dbackground/ScrollingA2DBackground.shtml

  9. 8.3 Tile-based Scrolling / Parallax Scrolling A sprite class is added to provide extra features for the sprite uses in the game.

  10. 8.3 Tile-based Scrolling / Parallax Scrolling A sprite class is added to provide extra features for the sprite uses in the game.

  11. 8.4 2D Camera Movement It supports a large world / level, and the game controls the camera to show proportion of the world.

  12. 8.5 Isometric View

More Related