O'Reilly logo

Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation by James A. Henley, Matthew Johnson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Canvas Component

The Canvas Component serves three main functions for the GUI display. First, it acts similarly to a parent object, controlling the overall layout of the GUI controls connected to it. Since the Canvas Component must be attached to render GUI displays, think of it like an actual canvas; without it you would not be able to use your paints and realize your idea on screen.

Second, the Canvas Component controls the GUI display in 3D space. Setting the Render Mode for the Canvas gives us a few options. It will help determine whether the GUI is used as an overlay to the camera, or if the canvas is set to World Space, and then used as an element in the game world. We will look at this in more detail shortly.

Last, the Canvas Component ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required