WIP
This commit is contained in:
@@ -245,7 +245,8 @@ class Board {
|
||||
this.innerSize,
|
||||
this.cfg.showBorder ? this.borderWidth : 0,
|
||||
(this.cfg.showBorder ? this.borderWidth : 0) + this.margin,
|
||||
background
|
||||
background,
|
||||
this.cfg.tiles
|
||||
);
|
||||
|
||||
for (let rank = 0; rank < this.cfg.tiles; rank++) {
|
||||
|
||||
@@ -8,11 +8,28 @@ const drawRectangle = async (
|
||||
height: number,
|
||||
x: number,
|
||||
y: number,
|
||||
squareStyle: SquareStyle
|
||||
squareStyle: SquareStyle,
|
||||
tiles: number = 8
|
||||
) => {
|
||||
if (squareStyle.type === "image") {
|
||||
const img = await loadImage(squareStyle.data.src);
|
||||
ctx.drawImage(img, x, y, width, height);
|
||||
|
||||
if (tiles < 8) {
|
||||
ctx.drawImage(
|
||||
img,
|
||||
0,
|
||||
0,
|
||||
img.width * (tiles / 8),
|
||||
img.height * (tiles / 8),
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
);
|
||||
} else {
|
||||
ctx.drawImage(img, x, y, width, height);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import calm from "./gradient/calm";
|
||||
import laguna from "./gradient/laguna";
|
||||
import sunset from "./gradient/sunset";
|
||||
|
||||
// import kittens from "./pic/kittens";
|
||||
import wood1 from "./pic/wood1";
|
||||
import wood2 from "./pic/wood2";
|
||||
import wood3 from "./pic/wood3";
|
||||
@@ -32,7 +31,6 @@ const styles = {
|
||||
calm,
|
||||
laguna,
|
||||
sunset,
|
||||
// kittens,
|
||||
wood1,
|
||||
wood2,
|
||||
wood3,
|
||||
|
||||
@@ -36,6 +36,7 @@ const style: Style = {
|
||||
onDark: "#eee",
|
||||
onBorder: "#ffffffbb",
|
||||
},
|
||||
ico: "/textures/wood01_ico.png",
|
||||
};
|
||||
|
||||
export default style;
|
||||
|
||||
@@ -36,6 +36,7 @@ const style: Style = {
|
||||
onDark: "#eee",
|
||||
onBorder: "#ffffffbb",
|
||||
},
|
||||
ico: "/textures/wood02_ico.png",
|
||||
};
|
||||
|
||||
export default style;
|
||||
|
||||
@@ -36,6 +36,7 @@ const style: Style = {
|
||||
onDark: "#eee",
|
||||
onBorder: "#ffffffbb",
|
||||
},
|
||||
ico: "/textures/wood03_ico.png",
|
||||
};
|
||||
|
||||
export default style;
|
||||
|
||||
@@ -36,6 +36,7 @@ const style: Style = {
|
||||
onDark: "#eee",
|
||||
onBorder: "#ffffffbb",
|
||||
},
|
||||
ico: "/textures/wood04_ico.png",
|
||||
};
|
||||
|
||||
export default style;
|
||||
|
||||
Reference in New Issue
Block a user