Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rudifa/hexgriddemo
Develop HexGrid boards
https://github.com/rudifa/hexgriddemo
Last synced: 24 days ago
JSON representation
Develop HexGrid boards
- Host: GitHub
- URL: https://github.com/rudifa/hexgriddemo
- Owner: rudifa
- Created: 2021-11-27T14:00:49.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-05T21:05:16.000Z (almost 3 years ago)
- Last Synced: 2024-10-06T01:41:22.606Z (about 1 month ago)
- Language: Swift
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Developing Hex Boards
Objective: create a set of SwiftUI components suitable for composing game boards
tiled with hexagons.Uses the HexGrid package, a swift port of Amit Patel's Hex + Layout library, morphed from the javascript version.
## Offset vs position
[Making Fine Adjustments to a View’s Position](https://developer.apple.com/documentation/swiftui/making-fine-adjustments-to-a-view-s-position)
```
To explicitly position elements within a view, use the position(x:y:) view modifier. A position modifier overrides where the parent view places its content. The modifier renders the view at a location offset from the origin of the parent view, unlike an offset modifier that shifts the view from the location chosen by the parent view. The position modifier uses the same x, y coordinate system as the offset modifier, and similarly doesn’t influence the size of the view.
```