Adding a registration target

The cursor helps guide the position of the capture. We also need something to guide the size. A circle will do.

We have created a Unity package with graphics we can use. This package also includes arrow graphics and other prefabs that will be used later in the project. If you haven't already, please download the file ChangeATire-ARGraphics.unity from the publisher's site for this book.

  1. From the main menu, select Assets | Import Package | Custom Package..., find the ChangeATire-ARGraphics package, and import it.

The package includes a circle.png sprite that we can use now.

  1. On AR Prompt, create a UI | Image, and name it AR Prompt Idle.
  2. Set its Source Image to Circle.
  3. Set its Width and Height to 400, 400.

We can leave everything else as the default settings; we want it just centered on the screen.

We'll provide some on-screen instructions to the user. Position it beneath the circle.

  1. On AR Prompt, create UI | Text and name it AR Prompt Text.
  2. Text: Align outline to tire, then press Capture Target.
  3. Anchor Presets to Middle/Stretch.
  4. Font Style: Bold.
  5. Align: Center, Middle.
  6. Horizontal Overflow: Overflow.
  7. Pos Y: -220.

Save your work. Then press Play. The following screenshot shows how our AR Mode screen looks, with a small dot cursor in the middle, a circle image for guiding the image registration, and a text prompt (perhaps too small to read on this book's page):

At this point the AR Canvas in Hierarchy looks like this:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset