Lesson 04.1: Creating the Location class

In this lesson, we will create a class to hold the Location information (including a graphic file to display).

 

 

Summary

To add an image to your project:

  • Create the image in your preferred graphics program.
  • Add the file to the project, as an existing item.
  • Set the image’s “Build Action” property to “Resource”
  • When displaying the file, you will need to include the assembly (project) name where the file is located, along with the path (folders) to the image file.
    • For this project, it will be “/Engine;component/Image/Locations/Home.png” (for the Home location image).

 

Image Files

All image files, in a zip file

Or, download the individual images (right-click, and save to your disk):

Source Code

Location.cs

 

GameSession.cs

 

MainWindow.xaml

 

Return to main page

Leave a Reply

Your email address will not be published. Required fields are marked *