EditorPanel.getTextAreaRect C# (CSharp) Method

getTextAreaRect() public method

public getTextAreaRect ( ) : Rect
return Rect
    public Rect getTextAreaRect()
    {
        return textAreaRect.getRect();
    }

Usage Example

Example #1
0
//  void leftPanel()
//  {
//      GUI.DrawTexture(editorPanel.getRect(),left_panel_background);
//      //GUI.DrawTexture(new Rect(0,0,Screen.width*3/4,Screen.height),left_panel_background);
//      GUILayout.BeginArea(new Rect(120,40,Screen.width*3/4,Screen.height));
//
//      scroll_position = GUILayout.BeginScrollView (scroll_position, GUILayout.Width(Screen.width*3/4-200), GUILayout.Height(Screen.height-60 )); // Should vary the size of the last rect by how much text we have??
//      foreach (Tuple<Rect, Texture2D> tup in (new Highlight()).highlightPage(current_code)) {
//          GUI.DrawTexture(tup.Item1, tup.Item2);
//      }
//      foreach (Tuple<Rect, Texture2D> tup in (new Highlight()).highlightErrors(current_code, error_lines)) {
//          GUI.DrawTexture(tup.Item1, tup.Item2);
//      }
//      showCode();
//      GUILayout.EndScrollView ();
//      GUILayout.EndArea();
//  }

    public void showHighlightedCode()
    {
        GUILayout.BeginArea(editorPanel.getTextAreaRect());
        scroll_position = GUILayout.BeginScrollView(scroll_position, GUILayout.Width(editorPanel.getScrollWidth()), GUILayout.Height(editorPanel.getScrollHeight()));  // Should vary the size of the last rect by how much text we have??
        foreach (Tuple <Rect, Texture2D> tup in (new Highlight()).highlightPage(current_code))
        {
            GUI.DrawTexture(tup.Item1, tup.Item2);
        }
        foreach (Tuple <Rect, Texture2D> tup in (new Highlight()).highlightErrors(current_code, error_lines))
        {
            GUI.DrawTexture(tup.Item1, tup.Item2);
        }
        showCode();
        GUILayout.EndScrollView();
        GUILayout.EndArea();
    }