-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example: Start spining after page loaded #17
example: Start spining after page loaded #17
Conversation
cc64f56
to
93226af
Compare
Example to show to programmatically control properties Change-Id: I140ec2892d3b2a4524183630984b6c7ee7fb6eb9 Bug: caseyyee#17 Relate-to: https://github.com/aframevr/aframe/blob/master/docs/introduction/javascript-events-dom-apis.md Signed-off-by: Philippe Coval <p.coval@samsung.com>
93226af
to
68c85b1
Compare
Start spining after page loaded Example to show to programmatically control properties Change-Id: I140ec2892d3b2a4524183630984b6c7ee7fb6eb9 Bug: caseyyee#17 Relate-to: https://github.com/rzr/webthing-iotjs/wiki/XR Signed-off-by: Philippe Coval <p.coval@samsung.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this :) I think besides that, the comment made about setTimeout, the rest looks good.
examples/basic/index.html
Outdated
@@ -95,6 +95,9 @@ | |||
clearInterval(interval); | |||
} | |||
}); | |||
setTimeout(function(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rather than doing a setTimeout
, we can just set the value to 1 in the markup so that it is spinning from the start?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I can change this to static, but I the reason I prefered to delay the start was mostly to show how to change attribute dynamically from javascript... this is where that update method is relevant... so I thought this example will illustrate more the real use.
For the context I plan to use widgets also in read only mode and change them from external events, eg:
http://github.com/SamsungInternet/color-sensor-js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Just don't want anyone confused about why the value changed if they don't look at the code. Maybe one possibility is to hook up one of the buttons so that it toggles the switch? A bit of labeling using <a-text>
would go a long way as well. See https://aframe.io/docs/0.9.0/primitives/a-text.html
Given that the repo is pretty old, i'm going to bump the a-frame version up to something more current. Hopefully that won't break anything for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea this is what i am actually doing with my code ...
I have tested current aframe it seems to work , but I need to sort out how to use slider with mouse or gearvr2 controller..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm. Yeah, mouse-click and pan is difficult since it's also used for panning/rotating the scene. Any ideas?
This change allows an element to be changed programmatically: ```js valueSlider.setAttribute('ui-slider', 'value', Math.random()); ``` Change-Id: I140ec2892d3b2a4524183630984b6c7ee7fb6eb9 Bug: caseyyee#17 Relate-to: https://github.com/rzr/webthing-iotjs/wiki/XR Signed-off-by: Philippe Coval <p.coval@samsung.com>
This change allows an element to be changed programmatically: ```js let value = Number(valueSlider.getAttribute('ui-slider')['max'] || 1); value *= Math.random(); valueSlider.setAttribute('ui-slider', 'value', value); ``` Change-Id: Ie9c2fa400ffaf2b555cee9d7f81fa9f4c4977d36 Bug: caseyyee#17 Relate-to: https://github.com/rzr/webthing-iotjs/wiki/XR Signed-off-by: Philippe Coval <p.coval@samsung.com>
Change-Id: I6a3f8c788ead485d0ed9d45856f1132b562b6b61 Signed-off-by: Philippe Coval <p.coval@samsung.com>
68c85b1
to
8675493
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, going to accept these changes.
Thanks @rzr!
Example to show to programmatically control properties
Change-Id: I140ec2892d3b2a4524183630984b6c7ee7fb6eb9
Relate-to: https://github.com/aframevr/aframe/blob/master/docs/introduction/javascript-events-dom-apis.md
Signed-off-by: Philippe Coval p.coval@samsung.com