Ejemplo n.º 1
0
    public void OnPower()
    {
        IsStarting = true;
        TextAsset code = Resources.Load("start") as TextAsset;

        // draw logo
        Texture2D logo    = Resources.Load("logo") as Texture2D;
        int       xcenter = (DisplaySystem.WIDTH - logo.width) / 2;
        int       ycenter = (DisplaySystem.HEIGHT + logo.height) / 2;

        _screen.SetFontColor(Color.white);
        _screen.SetBackColor(Color.black);
        _screen.Clear();
        _screen.DrawImage(xcenter, ycenter, logo.width, logo.height, logo.GetPixels());

        _runner.RunCode(code.text);
    }
Ejemplo n.º 2
0
    public void DrawBorder()
    {
        Color tmp = Screen.GetFontColor();

        Screen.SetFontColor(borderColor);
        for (int i = 0; i < DisplaySystem.COLS; i++)
        {
            for (int j = 0; j < borderHeight; j++)
            {
                Screen.TypeChar(1, i, j);
                Screen.TypeChar(1, i, DisplaySystem.LINES - 1 - j);
            }
        }
        for (int i = 0; i < DisplaySystem.LINES; i++)
        {
            for (int j = 0; j < borderWidth; j++)
            {
                Screen.TypeChar(1, j, i);
                Screen.TypeChar(1, DisplaySystem.COLS - 1 - j, i);
            }
        }
        Screen.SetFontColor(tmp);
    }
Ejemplo n.º 3
0
    void SetColor(int r, int g, int b)
    {
        Color c = Utils.ParseColor(r, g, b);

        _console.Invoker.Add(() => _display.SetFontColor(c));
    }