---
title: "setPosition(_:forDirectionPadElement:)"
framework: gamecontroller
role: symbol
role_heading: Instance Method
path: "gamecontroller/gcvirtualcontroller/setposition(_:fordirectionpadelement:)"
---

# setPosition(_:forDirectionPadElement:)

Changes the value of a directional pad element in the virtual controller.

## Declaration

```swift
func setPosition(_ position: CGPoint, forDirectionPadElement element: String)
```

## Parameters

- `position`: A point with x and y values in the range [0.0, 1.0].
- `element`: The name of the directional pad element to update.

## Discussion

Discussion Use this method to update the value of a directional pad in the virtual controller when you set the isHidden property to true and present your own virtual controller interface.

## See Also

### Presenting a custom interface

- [setValue(_:forButtonElement:)](gamecontroller/gcvirtualcontroller/setvalue(_:forbuttonelement:).md)
