# Get Button position in Scrollview Coordinates

**URL:** https://discussions.unity.com/t/get-button-position-in-scrollview-coordinates/656149
**Category:** UGUI
**Tags:** UGUI
**Created:** [February 21, 2017, 8:34pm UTC](https://discussions.unity.com/t/get-button-position-in-scrollview-coordinates/656149 "2017-02-21T20:34:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Smaselll](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Smaselll](https://discussions.unity.com/u/Smaselll)
#### Post date: [February 21, 2017, 8:34pm UTC](https://discussions.unity.com/t/get-button-position-in-scrollview-coordinates/656149/1 "2017-02-21T20:34:47Z")

</div>

Hi!!  
I have my Button in ScrollVIew area! And I want my ScrollView start position to equal Button.position!  
How can I convert Button position to ScrollView start position?

---

<div class="post-metadata">

### Author: ![Hosnkobf](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/hosnkobf/32/610679_2.png) [@Hosnkobf](https://discussions.unity.com/u/Hosnkobf)
#### Post date: [February 22, 2017, 2:56pm UTC](https://discussions.unity.com/t/get-button-position-in-scrollview-coordinates/656149/2 "2017-02-22T14:56:01Z")

</div>

you have to set the pivot of the content object.  
Not sure but I think you can calculate the pivot this way (for horizontal position):

```csharp
float hPos = button.transform.localPosition.x / (content.transform as RectTransform).sizeDelta.x;

```

code is not tested.
