Skip to content

Commit fe5d0d4

Browse files
canvas
1 parent 8269080 commit fe5d0d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+27
-2427
lines changed

13-canvas/flappy_bird/flappy_bird_v1_基本实现/loadImage.js renamed to 13-canvas/45-loadImage.html

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
<script>
9+
loadImage({
10+
img1: './images/sunshine.png',
11+
img2: './images/NPC1.png'
12+
}, function( imgObj ) {
13+
console.log( imgObj.img1.width );
14+
console.log( imgObj.img2.width );
15+
console.log( imgObj );
16+
});
17+
118
/*
2-
* function { loadImage } 加载图片资源
3-
* param { imgUrl: Object } 按照key,val形式存储要加载图片资源
4-
* param { fn: Function } 加载完毕之后,把资源传给这个回调
5-
* */
19+
* function { loadImage } 加载图片资源
20+
* param { imgUrl: Object } 按照key,val形式存储要加载图片资源
21+
* param { fn: Function } 加载完毕之后,把资源传给这个回调
22+
* */
623
function loadImage( imgUrl, fn ) {
724

825
var imgObj = {}; // 保存图片资源
@@ -28,4 +45,7 @@
2845
imgObj[ key ] = tempImg;
2946
}
3047

31-
}
48+
}
49+
</script>
50+
</body>
51+
</html>
File renamed without changes.

13-canvas/flappy_bird/flappy_bird/00loadImage测试.html

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)