Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebakerio authored Aug 19, 2021
1 parent 2661962 commit 5e7318b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This one is revived from back in the olden days! 0.4.0 is close to as old as I've seen. Very cool that this 5 year old code can still be called into service.

I've wanted this for a while, but I googled, found this, and then found this pull request on it:
https://github.com/chenzlabs/stats-in-vr/pull/1
I've wanted this for a while, but I googled, found this, and then found what looked like a [promising pull request](https://github.com/chenzlabs/stats-in-vr/pull/1
).

Which, with just one tiny bug fix, was found to work even on 1.2.0: https://glitch.com/edit/#!/stats-in-vr?path=index.html%3A36%3A53
Which, with just one tiny bug fix, was found to work even on 1.2.0!

~~though it seems the bars may not be working properly and that they perhaps used to. perhaps some more tinkering is in order?~~ Got the bars working again. :D Also spent a few hours going over it, refactoring stuff in the process. ~~I now realize it adds about 40-50 draw calls or so, because it works by adding a ton of images with canvas with text as textures for every value.~~ NM, fixed that too. Now all text stats are rendered as one buttery smooth image with canvas texture.

Expand All @@ -19,18 +19,17 @@ stats-in-vr component for [A-Frame](https://aframe.io).

![stats-in-vr](https://user-images.githubusercontent.com/6391152/130007970-a512c190-0a4e-4f0d-8c40-0d8e1e9e58e8.png)
![pick-graphs](https://user-images.githubusercontent.com/6391152/130017676-8de7e02b-268e-4896-89cb-3006e5a8dd58.png)
The stats-in-vr component allows the A-Frame scene stats component to be visible in VR!


## Example
## Examples

### default
### default behavior:
when you enter VR, text stats get attached to your face. When you are not in VR, you see normal 2d stats.
```html
<a-scene stats-in-vr></a-scene>
```

### attach stats to your left hand when you enter vr
### attach stats to your left hand when you enter vr:
```html
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/[email protected]/dist/aframe-extras.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/kylebakerio/[email protected]/stats-in-vr.js"></script>
Expand All @@ -49,8 +48,8 @@ when you enter VR, text stats get attached to your face. When you are not in VR,
</a-scene>
```

### make it a permanent fixture in your scene, vr or not
stick a VR panel somewhere you want in the scene, and make it stay there.
### make it a permanent fixture in your scene, vr or not:
stick a VR panel somewhere you want in the scene, and make it stay there, whether you're in VR or not.
```html
<a-scene stats-in-vr="anchorel:#the-box;position:0 .4 0;showallgraphs:true; alwaysshow3dstats:true; show2dstats:false;" >
<a-circle
Expand Down Expand Up @@ -93,7 +92,7 @@ https://glitch.com/edit/#!/stats-in-vr?path=index.html%3A17%3A30

#### Browser

Install and use by directly including the [browser file](dist):
Install and use by directly including the [browser file](https://cdn.jsdelivr.net/gh/kylebakerio/[email protected]/stats-in-vr.js):

```html
<head>
Expand Down

0 comments on commit 5e7318b

Please sign in to comment.