Book Image

Panda3D 1.7 Game Developer's Cookbook

Book Image

Panda3D 1.7 Game Developer's Cookbook

Overview of this book

Table of Contents (20 chapters)
Panda3D 1.7 Game Developer's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Rendering images to the 2D layer


In this easy-and-short recipe you will learn how to display images in the 2D layer of Panda3D. For example, if you want to build 2D games or display a HUD in a shooter, this recipe is the way to go!

Getting ready

Apart from using the project structure found in Setting up the game structure found in Chapter 1, Setting Up Panda3D and Configuring Development Tools, you will need two texture images that will be displayed. Also, add an additional directory called textures to the project folder structure.

Note

Putting the image files into the textures directory is optional (you could also put them into the source directory) but will help you to keep your code and resources organized. You may also use a different image file format for your textures. Panda3D also supports JPEG and DDS, for example.

How to do it...

Follow these steps to put some images into the 2D rendering layer:

  1. Copy your texture image files to the textures directory and call them panda.png and test.png...