Example #1
0
    public void DrawBlack(string text, int x, int y)
    {
        int xoff = x;
        int yoff = 0;

        text = StringScrambler.GetScrambledString(text, 1 - 1);
        for (int i = 0; i < text.Length; ++i)
        {
            if (text[i] == '\n' || (int)text[i] == 10)
            {
                xoff = x;
                yoff++;
            }
            else
            {
                if (Random.value < 1)
                {
                    if (text[i] != ' ')
                    {
                        SetPixelFront(' ', xoff, y + yoff, 'x');
                    }
                }
                xoff++;
            }
        }

        //DrawRectBack (x, y, x + text.Length, y + 1, 'g');
    }
Example #2
0
    public void DrawTextSkipSpaces(string text, int x, int y, char col, float fade = 1, char backColor = ' ')
    {
        int xoff = x;
        int yoff = 0;

        text = StringScrambler.GetScrambledString(text, 1 - fade);
        for (int i = 0; i < text.Length; ++i)
        {
            if (text[i] == '\n' || (int)text[i] == 10)
            {
                xoff = x;
                yoff++;
            }
            else
            {
                if (Random.value < fade)
                {
                    if (text[i] != ' ')
                    {
                        SetPixelFront(text[i], xoff, y + yoff, col);
                        if (backColor != ' ')
                        {
                            SetPixelBack('█', xoff, y + yoff, backColor);
                        }
                    }
                }
                xoff++;
            }
        }

        //DrawRectBack (x, y, x + text.Length, y + 1, 'g');
    }
    public override void Update()
    {
        base.Update();

        if (constantScramble)
        {
            if (orgPrefix == null)
            {
                orgPrefix = prefix;
            }
            if (orgSuffix == null)
            {
                orgSuffix = suffix;
            }

            constantScrambleTimer -= Time.unscaledDeltaTime;
            if (constantScrambleTimer < 0)
            {
                constantScrambleTimer = constantScrambleSpeed;
                prefix          = StringScrambler.GetScrambledString(orgPrefix, .9f, "▀ ▄ █ ▌ ▐░ ▒ ▓ ■▪          ");
                suffixView.text = StringScrambler.GetScrambledString(orgSuffix, .9f, "▀ ▄ █ ▌ ▐░ ▒ ▓ ■▪           ");
            }
        }

        highlightedLastFrame = highlighted;

        if (highlighted && fadingIn)
        {
            //fade += 1.5f * Time.deltaTime * 30;
            //SpeedUpFadeIn();
        }

        if (highlighted)
        {
            if (listLink != null && listLink.currentPanelContentId != this.id)
            {
                listLink.currentPanelContentId = this.id;
                listLink.rightPanel.text       = data;
                listLink.rightPanel.BreakTextForLineLength(listLink.rightPanelContentWidth).CutTextForMaxLines(19);

                if (ContentAlign == SHAlign.Center)
                {
                    listLink.rightPanel.CenterTextForLineLength(listLink.rightPanelContentWidth);
                }

                listLink.rightPanel.ForcedSoftFadeIn();
            }
        }

        if (OnUpdate != null)
        {
            OnUpdate.Invoke();
        }
    }
Example #4
0
    public override void Redraw(int offx, int offy)
    {
        console.ClearMessagesAbove(0);

        time += Time.unscaledDeltaTime;
        //if (fade < 0.99f)
        //		return;

        base.Redraw(offx, offy);

        XX -= Time.unscaledDeltaTime * 30;
        int X = (int)XX;

        if (X < 0)
        {
            X += SHGUI.current.resolutionX;
        }

        int Y = 4;

        for (int i = 0; i < columns.Count - 1; ++i)
        {
            for (int j = 0; j < columns[i].Length; ++j)
            {
                if (columns[i][j] != ' ')
                {
                    ;
                }
                int startx = mapxcol(X + i);
                if (startx < SHGUI.current.resolutionX - 1)
                {
                    if (fade > 0.5f)
                    {
                        SHGUI.current.SetPixelFront(StringScrambler.GetScrambledString(columns[i][j] + "", 1 - fade)[0], startx, Y + j + (int)(mysin(time, startx)), 'w');
                    }
                }
            }
        }

        //APPFRAME.Redraw (offx, offy);
    }
Example #5
0
    public void DrawText(string text, int x, int y, char col, float fade = 1)
    {
        int xoff = x;
        int yoff = 0;

        text = StringScrambler.GetScrambledString(text, 1 - fade);
        for (int i = 0; i < text.Length; ++i)
        {
            if (text[i] == '\n' || (int)text[i] == 10)
            {
                xoff = x;
                yoff++;
            }
            else
            {
                if (Random.value < fade)
                {
                    if (text[i] == headChar)
                    {
                        col = 'r';
                    }
                    else if (text[i] == tailChar)
                    {
                        col = 'r';
                    }
                    else if (text[i] == wireChar)
                    {
                        col = 'z';
                    }

                    SHGUI.current.SetPixelBack(text[i], xoff, y + yoff, col);
                    xoff++;
                }
            }
        }
    }