larspetrus / Roofpig

Rubik's Cube animation for the modern web.
MIT License
111 stars 29 forks source link

Feature request: pass moves interactively to cube #37

Open diegoboston opened 2 years ago

diegoboston commented 2 years ago

Hi all, I'm trying to build an interactive cube that I want to drive with some buttons. Is there a way to pass moves to a cube? The examples don't seem to suggest this feature. I would build a rows of buttons (L D R F U etc) and my button's onclick would trigger a function like:

var cube = getCube() cube.move("L")

Thanks for helping.

dunkelziffer commented 1 year ago

As far as I remember, that's not possible directly, but you should be able to make the button switch focus over to a cube and then send a keyboard event. That would be a hacky workaround, but it should work.

bcube2 commented 10 months ago

If you are still looking for a solution, using buttons to do moves is currently being discussed for a similar simulator called AnimCubeJS: https://github.com/cubing/AnimCubeJS/issues/33