> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksscrollarea.md).

# Class ksScrollArea

Namespace: [KS.Unity.Editor](/reactor/api-reference/ks.unity.editor.md)\
Assembly: KSUnity-Editor.dll

A scroll area that can detect if the vertical and horizontal scroll bars are showing. For it to work properly, the last rect drawn in the scroll area must be the lowest and right-most rect in the scroll area.

```csharp
public class ksScrollArea
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksScrollArea](/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksscrollarea.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksScrollArea(EditorWindow) <a href="#ks_unity_editor_ksscrollarea__ctor_unityeditor_editorwindow" id="ks_unity_editor_ksscrollarea__ctor_unityeditor_editorwindow"></a>

Constructor

```csharp
public ksScrollArea(EditorWindow window)
```

#### Parameters

`window` EditorWindow

Window the scroll area will be drawn in.

## Fields

### SCROLL\_BAR\_WIDTH <a href="#ks_unity_editor_ksscrollarea_scroll_bar_width" id="ks_unity_editor_ksscrollarea_scroll_bar_width"></a>

Width of a scroll bar.

```csharp
public const float SCROLL_BAR_WIDTH = 13
```

#### Field Value

[float](https://learn.microsoft.com/dotnet/api/system.single)

## Properties

### IsHorizontalBarVisible <a href="#ks_unity_editor_ksscrollarea_ishorizontalbarvisible" id="ks_unity_editor_ksscrollarea_ishorizontalbarvisible"></a>

Is the horizontal scroll bar visible? This is updated on a repaint event when [End](#KS_Unity_Editor_ksScrollArea_End) is called.

```csharp
public bool IsHorizontalBarVisible { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### IsVerticalBarVisible <a href="#ks_unity_editor_ksscrollarea_isverticalbarvisible" id="ks_unity_editor_ksscrollarea_isverticalbarvisible"></a>

Is the vertical scroll bar visible? This is updated on a repaint event when [End](#KS_Unity_Editor_ksScrollArea_End) is called.

```csharp
public bool IsVerticalBarVisible { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### ScrollPosition <a href="#ks_unity_editor_ksscrollarea_scrollposition" id="ks_unity_editor_ksscrollarea_scrollposition"></a>

Scroll position

```csharp
public Vector2 ScrollPosition { get; set; }
```

#### Property Value

Vector2

## Methods

### Begin() <a href="#ks_unity_editor_ksscrollarea_begin" id="ks_unity_editor_ksscrollarea_begin"></a>

Begins the scroll area.

```csharp
public void Begin()
```

### End() <a href="#ks_unity_editor_ksscrollarea_end" id="ks_unity_editor_ksscrollarea_end"></a>

Ends the scroll area. If the current event is a repaint event, updates [IsVerticalBarVisible](#KS_Unity_Editor_ksScrollArea_IsVerticalBarVisible) and [IsHorizontalBarVisible](#KS_Unity_Editor_ksScrollArea_IsHorizontalBarVisible), and repaints the window if either changed.

```csharp
public void End()
```
