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
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Qlik Sense: The Official Guide

You're reading from   Learning Qlik Sense: The Official Guide Get to grips with the vision of Qlik Sense for next generation business intelligence and data discovery

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781782173359
Length 230 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (14) Chapters Close

Preface 1. Coding with C++ FREE CHAPTER 2. Variables and Memory 3. If, Else, and Switch 4. Looping 5. Functions and Macros 6. Objects, Classes, and Inheritance 7. Dynamic Memory Allocation 8. Actors and Pawns 9. Templates and Commonly Used Containers 10. Inventory System and Pickup Items 11. Monsters 12. Spell Book Index

Displaying a quote from each NPC dialog box

To display a dialog box, we need a custom (heads-up display) HUD. In the UE4 editor, go to File | Add Code To Project... and choose the HUD class from which the subclass is created. Name your subclass as you wish; I've named mine MyHUD.

After you have created the MyHUD class, let Visual Studio reload. We will make some code edits.

Displaying messages on the HUD

Inside the AMyHUD class, we need to implement the DrawHUD() function in order to draw our messages to the HUD and to initialize a font to draw to the HUD with, as shown in the following code:

UCLASS()
class GOLDENEGG_API AMyHUD : public AHUD
{
  GENERATED_UCLASS_BODY()
  // The font used to render the text in the HUD.
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = HUDFont)
  UFont* hudFont;
  // Add this function to be able to draw to the HUD!
  virtual void DrawHUD() override;
};

The HUD font will be set in a blueprinted version of the AMyHUD class. The DrawHUD() function runs...

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