예제 #1
0
        public static void VerifyZoneContainsText(TextZone zone, string text, ref int contains, ref int preContains, ref int postContains)
        {
            var result = zone.SearchForText(text);

            foreach (TextZone z in result)
            {
                if (z.Text.Contains(text))
                {
                    contains++;
                }
                if (z.PreText.Contains(text))
                {
                    preContains++;
                }
                if (z.PostText.Contains(text))
                {
                    postContains++;
                }

                foreach (TextZone c in z.Children)
                {
                    VerifyZoneContainsText(z, text, ref contains, ref preContains, ref postContains);
                }
            }
        }
예제 #2
0
        private void ChangeTextProperty(DependencyProperty dp, string value)
        {
            if (TextZone == null)
            {
                return;
            }
            TextSelection ts = TextZone.Selection;

            if (ts != null)
            {
                ts.ApplyPropertyValue(dp, value);
            }
            TextZone.Focus();
        }
예제 #3
0
        private void UnderlineBnt_Unselected(object sender, RoutedEventArgs e)
        {
            if (TextZone == null)
            {
                return;
            }
            TextSelection ts = TextZone.Selection;

            if (ts != null)
            {
                (ts.GetPropertyValue(Inline.TextDecorationsProperty) as TextDecorationCollection).TryRemove(TextDecorations.Underline, out TextDecorationCollection textDecorations);
                ts.ApplyPropertyValue(Inline.TextDecorationsProperty, textDecorations);
            }
            TextZone.Focus();
        }
예제 #4
0
        public static void VisitTextZones(TextZone zone)
        {
            var preText  = zone.GetPreTextData();
            var postText = zone.GetPostTextData();
            var text     = zone.GetTextData();

            Assert.NotNull(text);
            Assert.NotNull(preText);
            Assert.NotNull(postText);

            foreach (TextZone z in zone.Children)
            {
                VisitTextZones(z);
            }
        }
예제 #5
0
    // Display Standard Text Box
    public void DisplayText(int objectID, TextZone textZone)
    {
        if (interactiveDialogue.ContainsKey(objectID))
        {
            tbManager = this.GetComponent <TextBoxManager>();

            if (tbManager != null)
            {
                tbManager.CreateTextBox(interactiveDialogue[objectID], null, textZone);
            }
            else
            {
                print("TextBoxManager is null!");
            }
        }
    }
예제 #6
0
        public void TextZone_Theory(string file)
        {
            using (FileStream stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
                using (DjvuReader reader = new DjvuReader(stream))
                {
                    TxtzChunk unk = new TxtzChunk(reader, null, null, null, stream.Length);

                    Assert.True(unk.TextLength > 0);
                    Assert.NotNull(unk.Text);
                    Assert.Equal(unk.TextLength, unk.Text.Length);
                    Assert.Equal(1, unk.Version);

                    TextZone zone     = unk.Zone;
                    var      preText  = zone.GetPreTextData();
                    var      postText = zone.GetPostTextData();
                    var      text     = zone.GetTextData();

                    Assert.NotNull(text);
                }
        }
    // Create a text box and animate the spoken dialogue
    public void CreateTextBox(List <string> dialogue, ShoutTextZone shoutZone, TextZone textZone)
    {
        if (shoutZone != null)
        {
            shoutZoneObject = shoutZone.transform.gameObject;
            textZoneObject  = null;
        }
        else if (textZone != null)
        {
            shoutZoneObject = null;
            textZoneObject  = textZone.transform.gameObject;
        }

        if (dialogue != null)
        {
            GameObject clone = Instantiate(textBoxPrefab) as GameObject;
            textPanel = clone.transform.GetChild(0).gameObject;                // Set panel
            boxText   = textPanel.transform.GetChild(0).GetComponent <Text>(); // Set text

            if (textFont)
            {
                boxText.font  = textFont;
                boxText.color = Color.red;
            }

            clone.transform.SetParent(canvas.transform, false); // Parent text box to canvas
            scrubbedText = dialogue;

            if (endLine == 0)
            {
                endLine = scrubbedText.Count - 1;
            }

            StartCoroutine(TextScroll(scrubbedText[currLine]));
        }
    }
예제 #8
0
 public PageTextItem(DjvuPage page, PageTextSearch parent, TextZone zone)
     : base(page)
 {
     _zone   = zone;
     _parent = parent;
 }
예제 #9
0
 public TextTimePeriod(TextZone zone)
 {
     Zone = zone;
 }