CodingTrain / CodingTrain/Suggestion-Box
Button text change on mouseWheel [solved]
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 570
- Fork
- 85
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi all,
I'm trying to change a button's text on mouseWheel according to the following array.
`let test = ["A", "B", "C", "D"];`
In my setup function, I'm creating the `button = createButton(test[current]);`
where current is set to 0, and I see my button named A, which is correct.
In mouseWheel, I've managed to increment "current" and I log the correct test[current], as it will display A at first, then B when mouseWheel happens, then C, etc.
How can I now apply this to my button's text?
Also, I would like that the mouseWheel function become available only if mouseOver. Is there any easy way to do that? Combining both mouseOver and mouseWheel.
Thank you so much!
EDIT : I've sort of managed to get around this by creating the button in HTML and changing the value with `document.getElementByID`, but I'd still like to have a solution that does not imply HTML tags.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Non viene indicato alcun file del repository né alcun test. Inizia esaminando il comportamento di p5.js createButton, mouseWheel e mouse-over descritto nell'issue. Il lavoro è considerato completato quando il testo del pulsante segue test[current] e la gestione della rotellina è limitata a mouse-over; le note di modifica menzionano una soluzione alternativa in HTML, ma non viene identificata alcuna implementazione nel repository.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100