Browse Source

Adding ESC instructions for multiexample

Josh Engebretson 9 years ago
parent
commit
5f7c73dab9

+ 2 - 0
FeatureExamples/CPlusPlus/Source/HelloGui.cpp

@@ -53,6 +53,8 @@ void HelloGui::Start()
     // Execute base class startup
     // Execute base class startup
     Sample::Start();
     Sample::Start();
 
 
+    SimpleCreateInstructions();
+
     // Create "Hello GUI"
     // Create "Hello GUI"
     CreateUI();
     CreateUI();
 
 

+ 2 - 0
FeatureExamples/CPlusPlus/Source/HelloWorld.cpp

@@ -51,6 +51,8 @@ void HelloWorld::Start()
     // Create "Hello World" Text
     // Create "Hello World" Text
     CreateText();
     CreateText();
 
 
+    SimpleCreateInstructions();
+
     // Finally subscribe to the update event. Note that by subscribing events at this point we have already missed some events
     // Finally subscribe to the update event. Note that by subscribing events at this point we have already missed some events
     // like the ScreenMode event sent by the Graphics subsystem when opening the application window. To catch those as well we
     // like the ScreenMode event sent by the Graphics subsystem when opening the application window. To catch those as well we
     // could subscribe in the constructor instead.
     // could subscribe in the constructor instead.

+ 8 - 1
FeatureExamples/CPlusPlus/Source/Sample.cpp

@@ -213,12 +213,19 @@ void Sample::SimpleCreateInstructions(const String& text)
     fontDesc->SetId("Vera");
     fontDesc->SetId("Vera");
     fontDesc->SetSize(18);
     fontDesc->SetSize(18);
 
 
+    String msgText = text;
+
+    if (text.Length() && !text.EndsWith("\n"))
+        msgText += "\n";
+
+    msgText += "Press ESC for menu";
+
     UIEditField* label = new UIEditField(context_);
     UIEditField* label = new UIEditField(context_);
     label->SetFontDescription(fontDesc);
     label->SetFontDescription(fontDesc);
     label->SetReadOnly(true);
     label->SetReadOnly(true);
     label->SetMultiline(true);
     label->SetMultiline(true);
     label->SetAdaptToContentSize(true);
     label->SetAdaptToContentSize(true);
-    label->SetText(text);
+    label->SetText(msgText);
     layout->AddChild(label);
     layout->AddChild(label);
 
 
     FeatureExamples::GetUIView()->AddChild(layout);
     FeatureExamples::GetUIView()->AddChild(layout);