CG回廊 #3
@ -8876,8 +8876,8 @@ core.plugin.animate = {
|
|||||||
},
|
},
|
||||||
"光标设置": function () {
|
"光标设置": function () {
|
||||||
// 在此增加新插件
|
// 在此增加新插件
|
||||||
this.changeMouse = function (icon, div = 'gameGroup', translateX = 0, translateY = 0, scaleX = 1, scaleY = 1, degree = 0) {
|
this.changeMouse = function (icon, div = 'gameGroup', translateX = 0, translateY = 0, scaleX = 1, scaleY = 1, degree = 0, px = 0, py = 0) {
|
||||||
const canvas = document.createElement('canvas'); //CGui画布设置
|
const canvas = document.createElement('canvas');
|
||||||
canvas.width = 64
|
canvas.width = 64
|
||||||
canvas.height = 64
|
canvas.height = 64
|
||||||
|
|
||||||
@ -8890,10 +8890,10 @@ core.plugin.animate = {
|
|||||||
|
|
||||||
core.drawIcon(ctx, icon, 0, 0, 32, 32)
|
core.drawIcon(ctx, icon, 0, 0, 32, 32)
|
||||||
const data = canvas.toDataURL("image/png")
|
const data = canvas.toDataURL("image/png")
|
||||||
core.dom[div].style.cursor = `url(${data}),auto` //div为你要改变光标的元素,默认为包含状态栏的整个游戏画面
|
core.dom[div].style.cursor = `url(${data}) ${px} ${py},url(${data}),auto` //div为你要改变光标的元素,默认为包含状态栏的整个游戏画面,px/py为点击点偏移像素
|
||||||
}
|
}
|
||||||
this.removeMouse = function (div = 'gameGroup') {
|
this.removeMouse = function (div = 'gameGroup') {
|
||||||
core.dom[div].style.cursor = ''
|
core.dom[div].style.cursor = 'auto'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user