我一直在查看文档,但我无法解决这个问题。我试过做一些测试,但我还没有能够让它发挥作用。
这是我的一项考试......
如果你去......
http://fabricjs.com/video-element
...然后打开控制台并输入...
public static boolean gameIsWon(int[][] workingPuzzle, int[][] solvedPuzzle)
{
if (workingPuzzle[0][0] == solvedPuzzle[0][0] &&
workingPuzzle[0][1] == solvedPuzzle[0][1] &&
workingPuzzle[0][2] == solvedPuzzle[0][2] &&
workingPuzzle[0][3] == solvedPuzzle[0][3] &&
workingPuzzle[0][4] == solvedPuzzle[0][4] &&
workingPuzzle[0][5] == solvedPuzzle[0][5] &&
workingPuzzle[0][6] == solvedPuzzle[0][6] &&
workingPuzzle[0][7] == solvedPuzzle[0][7] &&
workingPuzzle[0][8] == solvedPuzzle[0][8] &&
workingPuzzle[1][0] == solvedPuzzle[1][0] &&
workingPuzzle[1][1] == solvedPuzzle[1][1] &&
workingPuzzle[1][2] == solvedPuzzle[1][2] &&
workingPuzzle[1][3] == solvedPuzzle[1][3] &&
workingPuzzle[1][4] == solvedPuzzle[1][4] &&
workingPuzzle[1][5] == solvedPuzzle[1][5] &&
workingPuzzle[1][6] == solvedPuzzle[1][6] &&
workingPuzzle[1][7] == solvedPuzzle[1][7] &&
workingPuzzle[1][8] == solvedPuzzle[1][8] &&
workingPuzzle[2][0] == solvedPuzzle[2][0] &&
workingPuzzle[2][1] == solvedPuzzle[2][1] &&
workingPuzzle[2][2] == solvedPuzzle[2][2] &&
workingPuzzle[2][3] == solvedPuzzle[2][3] &&
workingPuzzle[2][4] == solvedPuzzle[2][4] &&
workingPuzzle[2][5] == solvedPuzzle[2][5] &&
workingPuzzle[2][6] == solvedPuzzle[2][6] &&
workingPuzzle[2][7] == solvedPuzzle[2][7] &&
workingPuzzle[2][8] == solvedPuzzle[2][8] &&
workingPuzzle[3][0] == solvedPuzzle[3][0] &&
workingPuzzle[3][1] == solvedPuzzle[3][1] &&
workingPuzzle[3][2] == solvedPuzzle[3][2] &&
workingPuzzle[3][3] == solvedPuzzle[3][3] &&
workingPuzzle[3][4] == solvedPuzzle[3][4] &&
workingPuzzle[3][5] == solvedPuzzle[3][5] &&
workingPuzzle[3][6] == solvedPuzzle[3][6] &&
workingPuzzle[3][7] == solvedPuzzle[3][7] &&
workingPuzzle[3][8] == solvedPuzzle[3][8] &&
workingPuzzle[4][0] == solvedPuzzle[4][0] &&
workingPuzzle[4][1] == solvedPuzzle[4][1] &&
workingPuzzle[4][2] == solvedPuzzle[4][2] &&
workingPuzzle[4][3] == solvedPuzzle[4][3] &&
workingPuzzle[4][4] == solvedPuzzle[4][4] &&
workingPuzzle[4][5] == solvedPuzzle[4][5] &&
workingPuzzle[4][6] == solvedPuzzle[4][6] &&
workingPuzzle[4][7] == solvedPuzzle[4][7] &&
workingPuzzle[4][8] == solvedPuzzle[4][8] &&
workingPuzzle[5][0] == solvedPuzzle[5][0] &&
workingPuzzle[5][1] == solvedPuzzle[5][1] &&
workingPuzzle[5][2] == solvedPuzzle[5][2] &&
workingPuzzle[5][3] == solvedPuzzle[5][3] &&
workingPuzzle[5][4] == solvedPuzzle[5][4] &&
workingPuzzle[5][5] == solvedPuzzle[5][5] &&
workingPuzzle[5][6] == solvedPuzzle[5][6] &&
workingPuzzle[5][7] == solvedPuzzle[5][7] &&
workingPuzzle[5][8] == solvedPuzzle[5][8] &&
workingPuzzle[6][0] == solvedPuzzle[6][0] &&
workingPuzzle[6][1] == solvedPuzzle[6][1] &&
workingPuzzle[6][2] == solvedPuzzle[6][2] &&
workingPuzzle[6][3] == solvedPuzzle[6][3] &&
workingPuzzle[6][4] == solvedPuzzle[6][4] &&
workingPuzzle[6][5] == solvedPuzzle[6][5] &&
workingPuzzle[6][6] == solvedPuzzle[6][6] &&
workingPuzzle[6][7] == solvedPuzzle[6][7] &&
workingPuzzle[6][8] == solvedPuzzle[6][8] &&
workingPuzzle[7][0] == solvedPuzzle[7][0] &&
workingPuzzle[7][1] == solvedPuzzle[7][1] &&
workingPuzzle[7][2] == solvedPuzzle[7][2] &&
workingPuzzle[7][3] == solvedPuzzle[7][3] &&
workingPuzzle[7][4] == solvedPuzzle[7][4] &&
workingPuzzle[7][5] == solvedPuzzle[7][5] &&
workingPuzzle[7][6] == solvedPuzzle[7][6] &&
workingPuzzle[7][7] == solvedPuzzle[7][7] &&
workingPuzzle[7][8] == solvedPuzzle[7][8] &&
workingPuzzle[8][0] == solvedPuzzle[8][0] &&
workingPuzzle[8][1] == solvedPuzzle[8][1] &&
workingPuzzle[8][2] == solvedPuzzle[8][2] &&
workingPuzzle[8][3] == solvedPuzzle[8][3] &&
workingPuzzle[8][4] == solvedPuzzle[8][4] &&
workingPuzzle[8][5] == solvedPuzzle[8][5] &&
workingPuzzle[8][6] == solvedPuzzle[8][6] &&
workingPuzzle[8][7] == solvedPuzzle[8][7] &&
workingPuzzle[8][8] == solvedPuzzle[8][8]
)
return true;
else
return false;
}
...你得到以下物品......
canvas.toJSON();
...每个元素都输出为" src中没有保存字符串的图像。"
有没有人能够做到这一点?
由于