Skip to content
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

SimulateTouch example Javascript #230

Open
Al4He6 opened this issue Jul 23, 2024 · 0 comments
Open

SimulateTouch example Javascript #230

Al4He6 opened this issue Jul 23, 2024 · 0 comments

Comments

@Al4He6
Copy link

Al4He6 commented Jul 23, 2024

@sample Pressing Buttons

Needs to simulate down and up to trigger InTouch function
and animate runs repeatedly. This simulates one touch

function OnStart() {
lay = app.CreateLayout( "linear", "VCenter,FillXY" );

btn = app.AddButton( lay,"Press Me", 0.3, 0.1 );
btn.SetOnTouch( btn_OnTouch );

app.AddLayout( lay );

app.SimulateTouch( btn, 0.5, 0.5, "down" );
app.SimulateTouch( btn, 0.5, 0.5, "up" );

}

function btn_OnTouch() {
app.ShowPopup( "Button touched","long");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant