Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by JChiu · Aug 15, 2015 at 07:25 AM · unity 5textoverlapping

UI Test overlapping trouble (in Build)

https://www.youtube.com/watch?v=3NMyj1_91FA&feature=youtu.be

As depicted in the video, the sentences at the top changes according to whichever button is pressed below. But somehow, the old sentences remain until I maximise then minimise the window.

What could be the cause? As I shouldn't have to do that every time the text changes.
Here's the code that control the texts.

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
 public class Storytelling : MonoBehaviour {
     public Text story, opt1, opt2, opt3;
     public int curStoProgressIndex, choice1, choice2, choice3;
     public string[] scenario; 
 
     // Use this for initialization
     void Start () {
         curStoProgressIndex = PlayerPrefs.GetInt ("CurrentPage", 0);
         Screen.fullScreen = false;
     }
     
     // Update is called once per frame
     void Update () {
         switch (curStoProgressIndex) {
         case 0:
             story.text = "Azaria has finally arrived home and when he is about to unlock the front door," +
                 "\n he forgot his key, but he....";
             ButtonSenarios("Kick the door down", 1, "Lick the keyhole", 2);
             break;
         case 1:
             story.text = "He tries to kick the door down, in fact, he kicks it soo hard that " +
                 "\n he bent his knee backward. He screams like a cat.";
             ButtonSenarios("He should cook his knee", 3, "He should unbent his knee", 4, "Do nothing about the knee", 5);
             break;
         case 2:
             story.text = "He suddenly remembers that he live in a gingerbread house. Thus no key required. " +
                 "\n he's in and he heads to.....";
             ButtonSenarios("Kicthen", 6, "Bedroom", 7, "Artic", 8);
             break;
         case 3:
             story.text = "He limbs into the kitchen and hack off his broken leg with a ________ knife";
             ButtonSenarios("butter", 9, "butcher", 10);
             break;
         case 4:
             story.text = "He tries to bend his leg back into how it was but he make it worse now he is inside a box";
             ButtonSenarios("What?", 11, "Why?", 12);
             break;
         case 5:
             story.text = "Ending A: the lone turret";
             ButtonSenarios();
             break;
         case 6:
             story.text = "What is he doing in the kitchen?";
             ButtonSenarios("head towards the sink", 13, "head towards the stove", 14, "head towards the fridge", 15);
             break;
         case 7:
             story.text = "What is he doing in the bedroom?";
             ButtonSenarios("Undress", 16, "Sleep", 17);
             break;
         case 8:
             story.text = "Ending B: He walks downstair toward the attic, in there she discovered that she is right at the front " +
                 "door of her house";
             ButtonSenarios();
             break;
         case 9:
             story.text = "He brings his broken leg toward his head and proceed to spread butter on it. He wolfs down " +
                 "his entire leg. He becomes a bit tired after that so he heads toward the...";
             ButtonSenarios("Beadroom", 7);
             break;
         case 10:
             story.text = "Ending C: With a mighty swing, at first nothing happens, then a gust of blood exploded " +
                 "from his lower back and his top half slide off";
             ButtonSenarios();
             break;
         case 11:
             story.text = "What? wha what? whaat what what waaht";
             ButtonSenarios("What?", 11);
             break;
         case 12:
             story.text = "ending D: He cheated on his wife......";
             ButtonSenarios();
             break;
         case 13:
             story.text = "Ending E: He sits on one of the sinks with his pant down, clutching his knee. He then proceeds to drop the " +
                 "kids off at the pool. However, the kids don't like the swimming pool he have chosen, so they decided to " +
                 "forcefully board the bus and out they comes through everywhere where there is a hole but not the hole that" +
                 " they comes out of......Azaria combusted.";
             ButtonSenarios();
             break;
         case 14:
             story.text = "He strips naked in front of the stove, then proceed to lay as flat as possible on the stove " +
                 "facing downward. He turns all the dials to full. At first nothing happens, " +
                 "then a sensation of overwhelming bliss wash over him.";
             ButtonSenarios("So he is cooked, so what?", 18, "he's still a bit raw", 19);
             break;
         case 15:
             story.text = "Enind F: He strolls into the fridge and stare through a plastic glass at the end of " +
                 "the refrigerator, at the other end of the glass are a bunch of giant children.";
             ButtonSenarios();
             break;
         case 16:
             story.text = "He takes off every garments on his body. " +
                 "He uses a knife to take off his birthday suit.";
             ButtonSenarios(";", 20, ":", 21);
             break;
         case 17:
             story.text = "............................................................................." +
                 "...................................................................................," +
                 ".............................................";
             ButtonSenarios("................", 17, "the next mo4ni g", 22);
             break;
         case 18:
             story.text = "Azaria opens the front door. Immediately some kind of roast arouse his senses, " +
                 "so she went straight to investigate the source of the smell. Soon he found herself standing in " +
                 "front of a stove with a charred human body. He ate the body and.....";
             ButtonSenarios("he stood in front of the stove", 14, "he stood in front of the stove", 
                            14, "he stood in front of the stove", 14);
             break;
         case 19:
             story.text = "Ending G: A giant knife went down on his naked body, with even slices on a bed of rice.";
             ButtonSenarios();
             break;
         case 20:
             story.text = "Ending H: He eat himself like an Oroboros";
             ButtonSenarios();
             break;
         case 21:
             story.text = "He bent over and inserted his head into the gaping hole between his legs. " +
                 "First his head went in, then his torso and finally the rest of the leg. " +
                 "Forming into a giant egg and be ready to be reborn. ";
             ButtonSenarios();
             break;
         case 22:
             story.text = "Ending I: tT NESAT04 M)Otring, Whet6nQ HE nENBOCME s3H3e, SH45 BN09ELCE h2e3";
             ButtonSenarios();
             break;
         }
     }
 
     void ButtonSenarios (string firstSena = null, int fs_index = 0, string secSena = null, int ss_index = 0,
                          string thridSena = null, int ts_index = 0) {
         opt1.text = firstSena;
         choice1 = fs_index;
         opt2.text = secSena;
         choice2 = ss_index;
         opt3.text = thridSena;
         choice3 = ts_index;
     }
 
     public void Button1Clicked () {
         curStoProgressIndex = choice1;
         story.text = "";
     }
 
     public void Button2Clicked () {
         curStoProgressIndex = choice2;
         story.text = "";
     }
 
     public void Button3Clicked () {
         curStoProgressIndex = choice3;
         story.text = "";
     }
 }
 
Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tom01098 · Aug 15, 2015 at 09:08 AM 0
Share

We can't see your video, please set it to 'unlisted' rather than 'private'.

avatar image JChiu · Aug 16, 2015 at 03:00 AM 0
Share

Changed...

avatar image Vice_Versa · Aug 16, 2015 at 04:33 AM 0
Share

this is a strange one. try right before changing the new value of story, changing it to null or rather to "". then change it to the new story

avatar image JChiu · Aug 17, 2015 at 04:50 AM 0
Share

Nope, is not working.

avatar image paulgaze · Aug 17, 2015 at 05:59 AM 1
Share

$$anonymous$$aybe your camera isn't clearing the display? See what the clear flags of your camera are and try changing the background color to make sure working.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by JChiu · Aug 17, 2015 at 10:13 AM

Changed the clear flag from depth only to solid colour and now the problem solved.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

28 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

My code will not change Canvas Text at all [No errors] 3 Answers

Inputfield text to String variable 1 Answer

UI Text Disappears At Some Resolutions 1 Answer

Disable and Enable UI text in function 1 Answer

How would you lower the amount of visible text lines in a TMP_Text Component? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges