-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from maxxfrazer/docs-and-example
1.3.1 Update - DocC is looking a lot nicer now. - Changed some initialisers for RUIControls in minor ways. - If you're having trouble, swap out `RUI` parameter for `rui` in the initialisers. Otherwise there should be a recommended update Xcode presents to you.
- Loading branch information
Showing
18 changed files
with
274 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# ``RealityUI/HasARTouch`` | ||
|
||
## Overview | ||
|
||
HasARTouch makes it easy to add touch events similar to those seen with <doc:RUIControls>. | ||
|
||
Creating a method that inherits the protocol ``HasARTouch`` lets you use the callback methods to add your own custom events to this AR object. ``arTouchUpdated(at:hasCollided:)`` is not only called when you move your finger, but on every new frame in the RealityKit scene. | ||
|
||
If you want to use a specific plane, rather that the object's collision shape after the initial touch, just set-up the ``collisionPlane`` parameter. If it is set up, all touch event callbacks will have the collision location as the location on that plane. This is used in classes such as ``RUISlider``, so that you can keep moving the slider without needing to always touch the slider's thumb. | ||
|
||
## Topics | ||
|
||
### Touch Event Callbacks | ||
|
||
- ``arTouchStarted(at:hasCollided:)`` | ||
- ``arTouchUpdated(at:hasCollided:)`` | ||
- ``arTouchEnded(at:hasCollided:)`` | ||
- ``arTouchCancelled()`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# ``RealityUI/RUIButton`` | ||
|
||
A control that executes your custom code in response to user interactions. | ||
|
||
## Overview | ||
|
||
When you tap a button, the button performs any actions attached to it. | ||
|
||
## Topics | ||
|
||
### Creating a Button | ||
|
||
- ``init()`` | ||
- ``init(button:rui:touchUpInside:)`` | ||
- ``init(button:RUI:updateCallback:)`` | ||
|
||
### Button Action Callback | ||
|
||
- ``touchUpInside`` | ||
|
||
### Customising a Button | ||
|
||
- ``buttonColor`` | ||
- ``baseColor`` | ||
- ``compress`` | ||
- ``size`` | ||
- ``cornerRadius`` | ||
- ``padding`` | ||
- ``button`` | ||
- ``ButtonComponent`` | ||
- ``HasButton`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ``RealityUI/RUISlider`` | ||
|
||
RUISlider is perfect for interpolating a value. | ||
|
||
![RealityUI Slider](ruislider-orange-example) | ||
|
||
```swift | ||
RUISlider(length: 4, start: 2 / 4) { | ||
print(slider.value) | ||
} | ||
``` | ||
|
||
## Topics | ||
|
||
### Creating a Slider | ||
|
||
- ``init()`` | ||
- ``init(length:start:steps:updateCallback:)`` | ||
- ``init(slider:rui:sliderUpdateCallback:)`` | ||
- ``init(slider:RUI:updateCallback:)`` | ||
|
||
### Slider Value Updates | ||
|
||
- ``sliderUpdateCallback`` | ||
- ``value`` | ||
- ``setPercent(to:animated:)`` | ||
- ``isContinuous`` | ||
|
||
### Slider Properties | ||
|
||
- ``steps`` | ||
- ``RUISlider/sliderLength`` | ||
- ``SliderComponent`` | ||
- ``HasSlider`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# ``RealityUI/RUIStepper`` | ||
|
||
A control for incrementing or decrementing a value. | ||
|
||
## Overview | ||
|
||
RUIStepper can be used for changing a value by either incrementing or decrementing based on a set value. This can also be used to cycle through a carousel of options by iterating over an array of elements. | ||
|
||
To activate the stepper, the user must press and release from the same side of the stepper. Holding the stepper will not repeatedly call the increment/decrement event. | ||
|
||
## Topics | ||
|
||
### Creating a Stepper | ||
|
||
- ``init()`` | ||
- ``init(upTrigger:downTrigger:)`` | ||
- ``init(style:upTrigger:downTrigger:)`` | ||
- ``init(stepper:rui:upTrigger:downTrigger:)`` | ||
|
||
### Stepper Value Updates | ||
|
||
- ``upTrigger`` | ||
- ``downTrigger`` | ||
|
||
### Customising | ||
|
||
- ``style`` | ||
- ``stepper`` | ||
- ``StepperComponent`` | ||
- ``HasStepper`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# ``RealityUI/RUISwitch`` | ||
|
||
``RUISwitch`` is a 3D toggle switch with an on and off state. | ||
Default bounding box is approximately 1.6x1x1m | ||
|
||
![RUISwitch floating around with an orange background](ruiswitch-orange-example.gif) | ||
|
||
```swift | ||
RUISwitch() { switch in | ||
print(switch.isOn) | ||
} | ||
``` | ||
|
||
## Topics | ||
|
||
### Creating a Switch | ||
|
||
- ``init()`` | ||
- ``init(switchness:rui:switchCallback:)`` | ||
- ``switchCallback`` | ||
- ``init(switchness:RUI:changedCallback:)`` | ||
|
||
### Customising The Switch | ||
|
||
- ``switchness`` | ||
- ``SwitchComponent`` | ||
- ``HasSwitch`` |
Oops, something went wrong.