Skip to content

Commit 570b0dc

Browse files
committed
Add ajiSetFillColor
1 parent 759a2b0 commit 570b0dc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

example/player/js/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ function setup() {
88
}
99

1010
function loop() {
11-
ajiContext.fillStyle = "#666666";
11+
ajiSetFillColor("#666666");
1212
ajiFillRect(0, 0, AJIPACK_WIDTH, AJIPACK_HEIGHT);
1313
ajiContext.font = "20pt sans-serif";
14-
ajiContext.fillStyle = "#fff";
14+
ajiSetFillColor("#fff");
1515
ajiDrawText("Hello, world!", x, 120);
1616
ajiDrawText(count, 10, 30);
1717
ajiDrawText("FPS: " + fps, 10, 60);

player.js

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ function ajiMain() {
4242
requestAnimationFrame(ajiMain);
4343
}
4444

45+
function ajiSetFillColor(color) {
46+
ajiContext.fillStyle = color;
47+
}
48+
4549
function ajiFillRect(x, y, w, h) {
4650
ajiContext.fillRect(x, y, w, h);
4751
}

0 commit comments

Comments
 (0)