示例#1
0
    // Hides or shows the textbox
    public void Hide()
    {
        SpriteRenderer renderer = textbox.GetComponent <SpriteRenderer>();

        // Show textbox
        if (renderer.color.a == 0f)
        {
            textbox.GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f);
            if (sprite != null)
            {
                sprite.drawZoom();
            }
            container.SetActive(true);
        }
        // Hide textbox
        else if (renderer.color.a == 0.5f)
        {
            textbox.GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 0f);
            if (sprite != null)
            {
                sprite.undrawZoom();
            }
            container.SetActive(false);
        }
        // Make textbox transparant
        else if (renderer.color.a == 1f)
        {
            textbox.GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 0.5f);
        }
    }
示例#2
0
 // Redraws the NPC zoom in face
 public void RedrawNPC()
 {
     if (sprite != null && mesh.text != "")
     {
         sprite.undrawZoom();
         sprite.drawZoom();
     }
 }
示例#3
0
    // Writes the given text strings to the screen
    public void WriteAll(List <string> t, npcSprite npc)
    {
        if (Time.time - timeLoc < textSpeed)
        {
            queue.Add(new Message(t, npc));
            return;
        }

        if (sprite != null)
        {
            sprite.undrawZoom();
        }
        if (npc == null)
        {
            sprite = null;
        }
        else
        {
            sprite = npc;
            sprite.drawZoom();
        }

        mesh.text  = "";
        text       = t;
        textScroll = 0;
        timeLoc    = Time.time;

        // Write out all of the text
        for (int i = 0; i < t.Count; i++)
        {
            mesh.text += t[i] + "\n";
        }
    }
示例#4
0
    // Writes the given text to the screen
    public void Write(string t, npcSprite npc)
    {
        if (Time.time - timeLoc < textSpeed)
        {
            queue.Add(new Message(t, npc));
            return;
        }

        if (sprite != null)
        {
            sprite.undrawZoom();
        }
        if (npc == null)
        {
            sprite = null;
        }
        else
        {
            sprite = npc;
            sprite.drawZoom();
        }

        text.Clear();
        text.Add(t);
        textScroll = 0;
        timeLoc    = Time.time;
        mesh.text  = t;
    }
示例#5
0
    // Writes the given text strings to the screen
    public void WriteAll(List<string> t, npcSprite npc = null, bool doNow = true)
    {
        if (npc != null && !doNow && Time.time - timeLoc < textSpeed)
        {
            queue.Add(new Message(t, npc));
            return;
        }

        if (sprite != null)
            sprite.undrawZoom();
        if (npc == null)
            sprite = null;
        else
        {
            sprite = npc;
            sprite.drawZoom();
        }

        mesh.text = "";
        text = t;
        textScroll = 0;
        timeLoc = Time.time;

        // Write out all of the text
        for (int i = 0; i < t.Count; i++)
            mesh.text += t[i] + "\n";
    }
示例#6
0
    // Writes the given text to the screen
    public void Write(string t, npcSprite npc = null, bool doNow = true)
    {
        if (npc != null && !doNow && Time.time - timeLoc < textSpeed)
        {
            queue.Add(new Message(t, npc));
            return;
        }

        if (sprite != null)
            sprite.undrawZoom();
        if (npc == null)
            sprite = null;
        else
        {
            sprite = npc;
            sprite.drawZoom();
        }

        text.Clear();
        text.Add(t);
        textScroll = 0;
        timeLoc = Time.time;
        mesh.text = t;
    }