2024-08-30 14:44:50
huas
0
安装最上面的几个库就行,大部分python应该都有import os
import json
from PIL import Image
import sys
# 确保Python使用UTF-8编码
sys.stdout.reconfigure(encoding='utf-8')
def parse_atlas(atlas_path):
#...
2024-08-24 16:04:02
huas
0
作为函数直接调用 this 指向为 window,作为对象/类中函数调用 this 指向为 对象/类箭头函数 () => {} 传入调用则 this 指向为传入时的类/对象参考如下代码,可以简单理解 function a() {
console.log(this);
}
a() // window
c...
2024-08-24 15:57:34
huas
0
参考下面图片getComponet为获取右侧列表中的组件,getComponetInChildren为从左侧hero节点下,遍历所有子节点中的组件获取要查找的组件.componets可以和图三右侧对应,children可以和图左侧enemy1对应
2024-08-12 20:01:38
huas
0
// canvas绘制文字自动换行
CanvasRenderingContext2D.prototype.wrapText = function (text, x, y, maxWidth, lineHeight) {
// 判断传参是否合法
if (typeof text != 'string' || typeof x != 'num...
2024-08-05 00:13:09
huas
0
:nth-of-type执行流程与说明当你使用其他非标签div、p....选择器时,浏览器会先行匹配选中的元素,然后解析元素的标签,最后通过标签所在父元素的位置进行匹配。选择器执行流程HTML<body>
<div class="father">
<div class="aaa"...