-
Notifications
You must be signed in to change notification settings - Fork 0
/
P5_pad.js
96 lines (93 loc) · 16.5 KB
/
P5_pad.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const img_down = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAE3ElEQVR42rWWa2wUVRTH/ztb2hJp6XMxUeoHrN0+eIhEwUailQiNH5oYP7p+MVqQthINgi/SEDS4RVqx8gaDoH5SsU9apGDF1hDTUkoB+5A+trul7IPtbtt9zMz1zMx2uk2qdBtmds7eO3c38//dc8499+ow1+uxD9jMATZLN9QZ/DydvkfIvPd7rS4SgBNfliBKr1P1GFNEGZt+fqOknADMRfTYQNb7QAGOlZfAdudumCBTW6m79BED3nyHAIbKKmj4FNnVBwpwZH8xbCPTAKIsHIIQGWIWJmLXnq8JYJ82AIf2FWPYNjpDlIVC0Dc4hgWxBnx/5gRg2a8FwE5WaS6G1ToKURIVp9xPgR4YQ2e3A5kZT6Dqx5PAcIU2HjiwtwhDw1JyM/mWGCy2cXTcsmPCx2NFthE1P5EHrAe0Aaj4bCsGLSOq+93eAK7edMDumpRpcgig7uxxAqjUJgRf7FEAWCj5unpc6CP3i6IgxyInOxP1Z48BtoPaAJTt3oqBIassbnf60HbDDr+fV5KRicjOykTDL0epBB3WBmBv6dvoH7TKgjd6XRiweqgvqpadlYXGqiPAnaMaAKTtZJ/u2iIDjHkCaKfY+3wBVVwky8rMwq/Vh4HR49oA7P54C273WzBk86Kn3x0SFsAEQQ6B0ZiNpppDwN2T2gCUfrQZff8M4Toln8M5SQCCAiEorTEzGxdrJYBvtADYwT7ZuRldN/vR8bcDQUq+qdmLchgEZBhz8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ooBoElGqi0bHee+BO6fMgegpKQQrt7rmHUv6GPPIWRZGwpG82EzAXQ2E4D7JzMADqsORxGc3dfg94varA+ZK7IOstn2KrpayNtz2gSAlw6rBXYHLl8ZgiRKRuwkSdKToPbLqTn4s/VzeuXUmQFQoX6424GOzkHdmIXMFW0C8u+btryGnrZqswAOqe9/UIjObgNAlh+Y8zYHSN2K3jZKwFtvAsCLh9R33itAt+vq8uhDIKRNtq3oa682C+CgmveuHS7XwPLKjTT4ZNxo247+CzyBBhMAXihXc9+2o6d30DA2qjcg+KrYaNuGgYsc4FczAParb+XZ0d83oK15ngBffqoxIfl7IYUSGOQAPjMAnv9U3ZlXiP7eAT3+pRNR4ZsOhuTU7bh6qdo8gB277PRPSFs0+jfk2zRdHEANb1jNS+C5vaq+zZJoexXUt128zfTq9R0r07s0BQDYQtphnFc7+E7o4R1RxONfEHilTmXmOLoAAAAASUVORK5CYII=";
const img_left = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEg0lEQVR42u2WW2wUVRjH/zO703u3m+1FmtA2Ghd6AywtVquEWChNoJEg0ZSHlReFaMBEU4I+EeMDycZgg4LiJSrBB2M0GDVeQEM0bIkJERvfFBOM9EJpS7vL7szuzBm/c5ndBfShSbu8OJsv58yZOd//d77vm3NWwx2+tP8BFvR249Ba/PXqKPWYsgICcHHNOIPLh7robobseuEAGoe6/EbZadvOBAlgJ41cIPu9IADGPQfWhUKhc0PPPmrsf/kECOAVGv6U7NelB6CVD27rPr+1v9vn9/uxc8/rHOA1ekIkuLi0ACT+yENtI7uf3OSPJywEq8rxxNNHOMAwPf1waQFIfHXr3SPPPzPgj8dN2A5DbagSkb1HCwBA4g3L62MH9m03EjdMOI4Dl4braqqw+4U3qedKc9X7rrqXN8rIrctuHlPDstXkzd+Hw9qt4tWh6tj+53YYyaRcORfgGo3L60QrDG62LySYK/wy3qr3mYvsXG/MzVv1SweplK4c2avli1dWBmP79jxmpC2LxB0loCYLEZcc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tg6vwwiwpLtd2yqq42iht+Z8VPP38IS/Oz9spJPBDA1I2zvLwxvEOczBKZeoLsBbu8v6fjQEgALP4+i8bGFgSCQUzFBpV4ObVDHPY18RBZt13eL0BMAKwklmnlQfwWJ/H0vcUdAO+ejgNcAJRNQ4U9faGuuPcA/lf4k8+8iNnJ0b/ccH8W9x6g8yDXdb3MMiMROmrinF+tJ+49QNfBOeTGf6AbbpNa42TReuLeA7Q+9RwKtx+jWpYs/nfi3gMAD5O1k+XJMnjg/wuUP+e7bVefev+x/4b/4PkDSQkibGffjc4AAAAASUVORK5CYII=";
const img_dOver = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEX7+/sAeAoAcAzb29ue56Si6Keg6KaUlJSB0YiA0IZ90IRwcHDPz8+B4Il5zYBXxWBb1WeR5Jhwy3gkqjFP0lyY5p92zX13zX5YwGIprDshqC5L0Fhmx24ysT9FuVAfqStIzlUAaguJ4pBpyHEaoCkHahJBuU0nrjJAyVAAYQ1HzVcGYBJ43YIYmik9s0k/yE8AWQx03H8wtUIXmCgAXw0AeQsgoy84xEsmjC5s2XcAWA4QbRuyxbS3z7kLfxdYy2Jo03Fu23cTkiQ1t0QqpzsMZxdmeGenp6eSrJQLgRVMwFdEuk5AtkoWlykIbhQ+UUB3d3e5ublSyFxIvVMXmCoNYhc8Tj6No5BPxlk6sUaOqJAKehVKxFYWmCc8TT6Noo9GwFIprTYJcRU7u0ozuEUfpS9GWEibm5sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+gY3FZAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAW1JREFUeNp90mdXwjAUBuC01AWyWkdbRlEigjUobS1ORhEnpeLAgVXB9f//gYkcUaHhfn2fvLk5JwAMhvkZlvEBr2G4iUk8HMexUz5vME1mxs8xgVkq8OMJUgEOQ/5QOMJSQBTnIT4szNHA/AK/yIuSHKMCnufjCZkOohgkZVlJLVHAMp8WBVmGqRUaSKczsgJhjNoQF1cVLLI5CgjGkwIugGsqDYgJBa8wpiEskBXoYD2p4PMQ0UGe5BBtbHoDtqCRBqRnDW+wVZBMUqAXR8B2/6ftkEcihIq7hmHk1L39ATgolSuVSLmK34CQbhU1rVY7rB8d/1acnJbPzjMNsgGyLdu2kdR0Llrgr7i8ajRMAizLtq6lm3ag9W+N29Jd5t4kG/RzZygH4KHzmCfAxTdI6tNIDsBz56ULkWtbSFIdjxx39F5N5Lq6pLY9c9zRe4Mu8rp/sGlPe09Qz3+LZld1xuRY1D/G5gC0PofyL5Q9QHHyqpuKAAAAAElFTkSuQmCC";
const img_uOver = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEX7+/vO5NAahiO0zrbM484SghtYwmGRq5MShxxw0nh804No0XEQhhqNp49xzXkLgRVoyXBvy3dg12pnyG+No5BgzWtmx25gxWhJvFJKzlcKeBVfxGdQv1kxszwgqisosTZBwk4psDQlrTM7vEoJchWSpJQYiCGB4Il42IBw3HtQ01tFxlI4xEswrj4JaBQAeAoAeQtRwFoAagsAYQ0TYB2nsKirq6t9fX1wcHB33oA8t0ZM0FlMTExkZGR+fn7a2trQ0NBGu1AfqSsAaA113X0aoClIxVRCylI0tD9HzVVo2nFEuk4YmikAWQw/yE9m2W8orzMfqC0XmiYAVg0AcwoXmCgSkCU2w0kxwERb1mcVlSYAdQxT0mAATw9xcXEQiyQATQ0YmydIzVguvkEAUQ6UlJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+5aoKcAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAW5JREFUeNp9kGsjwlAYgAstXWTddNORuaQLxzYyJWk5clmhsoYiqf//F5wzl9De3m87z/M+Z5vN9mfsc/O2WbPg4BzOGdy+6HJ7vEvwPuU+t2fZCe+7fLzfBxmU+/x+nk7A0mCcNyfIB70hK85geCUciUSisbjTin/SxGoSraXioSkejLBJcNF1ASFhY3PrN9/m0zuuTDrBcZSjbC6Xyu/uTQy7A2O8j3GacpHuZyVJkmX54HCSKBwpioKPRU4sIoRK0kmZPp8WJkLljA7OiGJVQIJaqpUL7OD/l+JzMZpEqkpisjIFTSFzwQKE1EGheomQSsgVJFzfCAK9Qas3IKEoIEKI1gSFpErfQNPykHB7d88CrXzbWugE2A3ag94FBBxQzYBuQIVHM/AEFp57LKDrutF/sS70WKClvxoDoJAl5K2lw0KnRP+BzoQ+IAy/hHdAkIb1ZrPbNQyoINVkuTEatQd9QKiMle8ZV35OPwBUqVXsA1W9CAAAAABJRU5ErkJggg==";
const img_lOver = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEX7+/vO5NASghsVhx4AeAqrq6va2tojkCyI35EAcAp+fn7Q0NDM485brGKk4qio5qxwcHBFoUyo46yb3KCr57Azlz2g4aWT2ZmR45iJ1pCF04ub4qEAeQsAdgwZiiJ70IF6z4GY5Z+V5JyK4JKP4pYAawuUlJR71oNwy3huyndryHNdwmdRwFpSv1tFt1BAsUs5sEUxskIzq0Exqz06rkVr1nhu0XZnyG9hyGpixWpaw2NIu1E8tkYfqSsiqDIboSgfojEcoiwYmSlByFEAYQ1hzWpcyGVBuUszsD8gqS0HYhFMwVYosDQhrC0krDEYmCcXligXmChCyVK0zrY3uUYUkCQTiyU+xk6Rq5MPgxtMx1YptDQXlSg5wksAWAyNpo8LfxdDw1AUjiY8xEw2wEgzvUg1v0cIeBQ8vUsHXRQAUgsAVQwATwySoZMJchNMTExkZGRxcXGNo5AIahPPz88trD6NoY8knTaNno4IVxQTVhynr6gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////jSBpEAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAZJJREFUeNrNkldXwjAYhlMEZTjqxlERUcSKozhBSyBVtAyto3VBXbiqOHH/eb+2Hr2i3Hl80iQX7/NlnAahP4Wqltuq5DV2R61VXud0uT2V8/qGxiY7XVmgmlta2ywEqr2js7OxskDVebu6unvsOr1Mr8vuYhjGxeijcWyqz+nz9fv8fr93oMdrEBgMOIHAUNC433B/CBhh2RA7Gh4bn5jkIlORyPT0xMwQDee3zbJz7Hw0Go0tLHJ8HPM4gZMkSQjBwhIN+fJ8KhYLr6zGRZHnMU5iTDAxEdI06sukwuHMZDa3JopiUkxgyMk6kQCysQkrbNmWM9vZnJgzyrFRK0kyNEWSd0BAu3v7Bzl9dT7xHcuyrCiKrOTlggoCOjw6zvIib24t/cTQT0wBjNM4lAuCUACKwBm04nmhuGMK6PCiEMfk8kpVtWvg5lrTUTVVXTIFVLrdTuTP1Lt7+uFB/34Jfv+NxyeOcNq9w1Mue6CXPTAZ/DyhUvqZ0yzeA0IvV6/WAnp7ryKg0ofbWkCfDvQ/+QL8QmM/hRUWMwAAAABJRU5ErkJggg==";
const img_rOver = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEX////O5NASghu0yrUAeQsQgRmWrZdwzXgThByUq5aC24p71oM5mEGSqpQAeAqE3IxrzHV91YQqkDKB2ohkx2xnyW941H4fiigAdwp92YRfxWdexGZgx2px0XkXhCCV5ZuT5ZqS5JmR5JiQ5JeO5JWN5JSM45SL4pKJ4pCI4pCH4Y6G4Y2E4YyD4YuB34mA34hbwmRYwWBXwGBZxGJpznEQfxmTqZVwzHhvy3huy3Vuy3dtynZrynNpyHFoyHBnyG9fxGdSwFtGvFA9t0c1tD8vsjoprzQkrS8irC8gqisiqzAiqy0mrDEqrjcztEBMw1YMexWTqJRtynVsynRqyXJpyXJmx25VwV5Euk41tUAnrzIhrS0hrC0hqywgqywgqi4fqSsfqC0epywepis7vEgKdxWTp5RpyXFoyXBbw2IztT4irS0fqS0dpSsdpCocoyogqC44ukUJdBOTp5WL45Naw2NCu00sszciri4coiwboigboSsboCoanyoaoCklqzQuqjwNaRi7u7tJvlMvtDoanikZnSgZnCgfpC41t0QHbRNEV0Wbm5tq23Qjry8iry4ZnigYnCcYmykXmigXmiYXmSgdoS8ytEEHaBQ7TDxzc3O5ublV1WAYmycWmCcWlycbniwwskEHZRM7SzxycnK0tLRU1WFT1GBR01xQ01tO0VtM0FlKz1dIzldGzVNEy1RCylJByVE/yE8+yE49x088xk47xk06xUwVlSYUlCUanC0tsD4GYhI7SjwAdQoAdAoAcgwAcQwAbgsAawsAaQ0AZgwAZAwAYg4AXw0AXQ0AXA0AWw0AWgwAWQwAWA4wtkIUkycZmywsrz0GYBPb29uUlJRwcHAAVw4wtUITkiQYmiwGXxM7STzPz88rrz0GXxIopTkHXxMhbytmdWd1dXW1tbXH0MesrKy6uroAAAAAAAAAAAAAAAAAAAAAAAAAAggAAABTjGxTjGwAAfgAAAEAAAAAAAAAAAAAAAAAAABTjJBTjJAAAdQAAABTjKBTjKCrJhp9AAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAbpJREFUeNpjYBgQwEhIARMzAQUsrGwEFLBzcOJXwMXNw4tPAR+/gKAQPhV8wiKiYuIwFSxwwMfCx8cnAQKSUtIysnJQFSzyCgqKSkrKKiqqauoamlraOrp6+gaGRsYmpmYQBYrmFpZW1ja2dvYOjk7OLq5u7h6eXt4+vn7+AYFgBcqWQcEhoWHhEZFR0TGxcZ7xCYmJSUCQ7JWSmgZSoBKSnpHplJWdDZLNSUxKTErOzc3LB4KCwqJioIKSsNKy8oqK6Ji4+ByQZF5+ZVV1TXVtbV1NfUNjEwOLRnNLRUU2SBokW1lVU1Pb2tbe1t7e3tHZ1d3DwNfb118RHRsXn5icm19VUzuhrX3ipMlTpk6dOm36jJmzZjPwzQEZ75mYlJsHlG6bO2ny1Hnz5s2fP3/BwkWLlywFBtucZctXrFy1es3ades3bNy0ecvWrdu279ixc9fuPXtB8gx8Evv2Hzh46PCRo8eOnzh56vSZs+fOnb9w4eKlyxB5hitXr6GD6zdu3rp0+w5EHqjiLjq4fuPWvftweSzg+o1Ll/HJM5x7AHUfLnDm4eJZ+OQZHj1+8hRvmnz2/AXDoAIADYnKTHyr9GsAAAAASUVORK5CYII=";
class Pad {
constructor(x, y, name) {
this.x = x;
this.y = y;
this.w = 32;
this.h = 32;
this.name = name || "Pad"
this.i_up = loadImage(img_up);
this.i_down = loadImage(img_down);
this.i_left = loadImage(img_left);
this.i_right = loadImage(img_right);
this.i_dOver = loadImage(img_dOver);
this.i_uOver = loadImage(img_uOver);
this.i_lOver = loadImage(img_lOver);
this.i_rOver = loadImage(img_rOver);
imageMode(CENTER);
rectMode(CENTER);
textAlign(CENTER);
}
show() {
fill(0);
textSize(12);
text(this.name,this.x, this.y-20);
image(this.i_up, this.x, this.y);
image(this.i_down, this.x, this.y + 42);
image(this.i_left, this.x - 20, this.y + 20);
image(this.i_right, this.x + 20, this.y + 20);
}
on_click_up(fnc) {
if (mouseX > this.x - this.w / 2 && mouseX < this.x + this.w / 2) {
if (mouseY > this.y - this.h / 2 && mouseY < this.y + this.h / 2) {
image(this.i_uOver, this.x, this.y);
}
}
if (mouseIsPressed) {
if (mouseX > this.x - this.w / 2 && mouseX < this.x + this.w / 2) {
if (mouseY > this.y - this.h / 2 && mouseY < this.y + this.h / 2) {
fnc.apply(this);
}
}
}
}
on_click_down(fnc) {
if (mouseX > this.x - this.w / 2 && mouseX < this.x + this.w / 2) {
if (mouseY > this.y - this.h / 2 + 42 && mouseY < this.y + this.h / 2 + 42) {
image(this.i_dOver, this.x, this.y+42);
}
}
if (mouseIsPressed) {
if (mouseX > this.x - this.w / 2 && mouseX < this.x + this.w / 2) {
if (mouseY > this.y - this.h / 2 + 42 && mouseY < this.y + this.h / 2 + 42) {
fnc.apply(this);
}
}
}
}
on_click_left(fnc) {
if (mouseX > this.x - this.w / 2 - 20 && mouseX < this.x + this.w / 2 - 20) {
if (mouseY > this.y - this.h / 2 + 20 && mouseY < this.y + this.h / 2 + 20) {
image(this.i_lOver, this.x - 20, this.y + 20);
}
}
if (mouseIsPressed) {
if (mouseX > this.x - this.w / 2 - 20 && mouseX < this.x + this.w / 2 - 20) {
if (mouseY > this.y - this.h / 2 + 20 && mouseY < this.y + this.h / 2 + 20) {
fnc.apply(this);
}
}
}
}
on_click_right(fnc) {
if (mouseX > this.x - this.w / 2 + 20 && mouseX < this.x + this.w / 2 + 20) {
if (mouseY > this.y - this.h / 2 + 20 && mouseY < this.y + this.h / 2 + 20) {
image(this.i_rOver, this.x +20, this.y+20);
}
}
if (mouseIsPressed) {
if (mouseX > this.x - this.w / 2 + 20 && mouseX < this.x + this.w / 2 + 20) {
if (mouseY > this.y - this.h / 2 + 20 && mouseY < this.y + this.h / 2 + 20) {
fnc.apply(this);
}
}
}
}
}