added rectMode(CENTER)

This commit is contained in:
Mees Roelofsz
2024-01-12 12:18:33 +01:00
parent ce44474901
commit 3986109669
2 changed files with 26 additions and 28 deletions

View File

@@ -75,6 +75,7 @@ function setup() {
createCanvas(width, height);
frameRate(framerate);
angleMode(DEGREES);
rectMode(CENTER);
// disable the outline of shapes
noStroke();
}
@@ -320,7 +321,7 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 90, height / 2, 200, 40)
rect(width / 2, height / 2, 200, 40)
pop()
}
if (buttonSelectHome == 1) {
@@ -328,7 +329,7 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 90, height / 2 + 50, 200, 40)
rect(width / 2, height / 2 + 50, 200, 40)
pop()
}
}
@@ -347,7 +348,8 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 100, height / 2, 200, 40)
rectMode(CENTER);
rect(width / 2, height / 2, 200, 40)
pop()
}
if (buttonSelectPause == 1) {
@@ -355,7 +357,8 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 100, height / 2 + 50, 200, 40)
rectMode(CENTER);
rect(width / 2, height / 2 + 50, 200, 40)
pop()
}
}
@@ -363,10 +366,11 @@ function draw() {
if (entered) {
if (buttonSelectDead == 0) {
push()
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 45, height / 2 - 30, 90, 40)
rect(width / 2, height / 2 - 15, 90, 40)
pop()
}
if (buttonSelectDead == 1) {
@@ -374,7 +378,7 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 55, height / 2 + 15, 110, 40)
rect(width / 2, height / 2 + 30, 110, 40)
pop()
}
if (buttonSelectDead == 2) {
@@ -382,7 +386,7 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 80, height / 2 + 60, 160, 40)
rect(width / 2, height / 2 + 75, 160, 40)
pop()
}
}
@@ -392,7 +396,7 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 45, height / 2 - 30, 30, 40)
rect(width / 2 - 30, height / 2 - 15, 30, 40)
pop()
}
if (iIndex == 1) {
@@ -400,7 +404,7 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 - 15, height / 2 - 30, 30, 40)
rect(width / 2, height / 2 - 15, 30, 40)
pop()
}
if (iIndex == 2) {
@@ -408,7 +412,7 @@ function draw() {
stroke(205, 205, 205)
strokeWeight(2)
fill(0, 0, 0, 0)
rect(width / 2 + 15, height / 2 - 30, 30, 40)
rect(width / 2 + 30, height / 2 - 15, 30, 40)
pop()
}
}