Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

button-behavior test V0 #725

Merged
merged 1 commit into from
Oct 6, 2020
Merged

button-behavior test V0 #725

merged 1 commit into from
Oct 6, 2020

Conversation

patole
Copy link
Contributor

@patole patole commented Oct 2, 2020

This test has just a square button in the middle of the scene and text above it. The text changes from the default state to indicate if the button detects either a quick click or a hold, then back to the default text after 1000 ms.


const testButtonBehavior = this.testButton.setBehavior(MRE.ButtonBehavior);
testButtonBehavior.onClick((_, __) => this.displayString("Click Detected!"));
testButtonBehavior.onButton('holding', () => this.displayString("Hold Detected!"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'holding' [](start = 30, length = 9)

I see this is written as v0 in the title. Is the desire to expand this to cover and test the other events for the button?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! I wrote this based on a sentence or two description from @sorenhan and wanted his input to see if there were more events desired in this, or if simply a click/press threshold test was sufficient.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well as the behavior system area owner, I would totally love to expand this and fully test the button. Let me know when you have time to discuss expanding this if you wanted to take that on as well. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, we can write this up after you're done with the media player work so as not to distract from that.

Copy link
Contributor

@tombuMS tombuMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@patole patole merged commit 9aea358 into master Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants