Last active
August 4, 2021 16:00
-
-
Save thacuber2a03/9537312764c68a429f6d99bb1557bc28 to your computer and use it in GitHub Desktop.
SCRIPT-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //title:Button Class | |
| init = state => { | |
| state.pressed = false; | |
| } | |
| update = (state, input, elapsed) => { | |
| if (input.a) { | |
| state.pressed = true; | |
| } else { | |
| state.pressed = false; | |
| } | |
| } | |
| draw = state => { | |
| clear(); | |
| let pressed = state.pressed; | |
| let button = new TextButton("test", 0, 0, 0, 5); | |
| let button2 = new TextButton("test", 0, 7, 0, 5); | |
| button.display(pressed); | |
| button2.display(!pressed); | |
| } | |
| class TextButton { | |
| constructor(text, x, y, c, c2, k) { | |
| this.text = text | |
| this.x = x | |
| this.y = y | |
| this.c = c | |
| this.c2 = c2 | |
| this.k = k | |
| this.a = false | |
| } | |
| display(a) { | |
| if (!a) { | |
| print(this.x, this.y+1, this.text, this.c2) | |
| print(this.x, this.y, this.text, this.c) | |
| } else { | |
| print(this.x, this.y+1, this.text, this.c) | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "iframeVersion": "0.1.280", | |
| "lines": [ | |
| 43, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0 | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment