Skip to content

Commit

Permalink
feat(component): make radius configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
techninja committed Jul 19, 2018
1 parent 307e78f commit 5b7e918
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dist/aframe-simple-link-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ AFRAME.registerComponent('simple-link', {
lookAtCamera: { default: true, type: 'boolean' },
href: { default: '', type: 'string' },
title: { default: '', type: 'string' },
radius: { default: 1, type: 'number' },
color: { default: '#fff', type: 'color' },
titleColor: { default: '#fff', type: 'color' },
image: { default: '', type: 'asset' },
Expand All @@ -106,7 +107,7 @@ AFRAME.registerComponent('simple-link', {

el.setAttribute('geometry', {
primitive: 'circle',
radius: 1
radius: this.data.radius
});
if (this.data.image) {
el.setAttribute('material', {
Expand Down
2 changes: 1 addition & 1 deletion dist/aframe-simple-link-component.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a-assets>
<img id="linkImage" src="./assets/link.png">
</a-assets>
<a-entity position="0 1 -5" simple-link="href: index.html; title: My Homepage; image: #linkImage; "></a-entity>
<a-entity position="0 1.5 -5" simple-link="href: index.html; title: My Homepage; image: #linkImage; radius:1.2;"></a-entity>
</a-scene>

<!-- GitHub Corner. -->
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ AFRAME.registerComponent('simple-link', {
lookAtCamera: { default: true, type: 'boolean' },
href: { default: '', type: 'string' },
title: { default: '', type: 'string' },
radius: { default: 1, type: 'number' },
color: { default: '#fff', type: 'color' },
titleColor: { default: '#fff', type: 'color' },
image: { default: '', type: 'asset' },
Expand All @@ -34,7 +35,7 @@ AFRAME.registerComponent('simple-link', {

el.setAttribute('geometry', {
primitive: 'circle',
radius: 1
radius: this.data.radius
});
if (this.data.image) {
el.setAttribute('material', {
Expand Down

0 comments on commit 5b7e918

Please sign in to comment.