Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Augmented Reality for Developers

You're reading from   Augmented Reality for Developers Build practical augmented reality applications with Unity, ARCore, ARKit, and Vuforia

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781787286436
Length 548 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Jonathan Linowes Jonathan Linowes
Author Profile Icon Jonathan Linowes
Jonathan Linowes
Krystian Babilinski Krystian Babilinski
Author Profile Icon Krystian Babilinski
Krystian Babilinski
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Augment Your World FREE CHAPTER 2. Setting Up Your System 3. Building Your App 4. Augmented Business Cards 5. AR Solar System 6. How to Change a Flat Tire 7. Augmenting the Instruction Manual 8. Room Decoration with AR 9. Poke the Ball Game

Abstract selection menu UI


The next feature we want to add is the ability to choose different frames and photo images for your pictures. For this, we'll develop a menu element using a modal design pattern. When a menu is activated, the user is presented with a set of choices. When a choice is selected, the choice is applied and the menu closes. It is modal because the menu remains active until the user has made his or her choice.

We will begin by writing an abstract PictureMenu class that implements the basic functionality of a menu. Then we'll use it for selecting the frames and images of the picture.

In our framework, a menu will be enabled by making it active in the Unity scene (using SetActive). When an object is activated, Unity will call OnEnable(), which we can use to begin using the menu. The abstract PictureMenu class expects the following methods in the derived classes:

  • InitMenu: Initialization code; called from Start()
  • BeginEdit: When the menu is opened; called from OnEnable()
  • ObjectClicked...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image