-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathccpoint.html
147 lines (127 loc) · 6.16 KB
/
ccpoint.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html dir="ltr" class="js desktop" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>ccpoint</title>
<script>
(function(H) {
H.className = H.className.replace(/\bno-js\b/, 'js')
})(document.documentElement)
</script>
<link rel="stylesheet" type="text/css" href="css.css">
<script type="text/javascript" charset="utf-8" src="js.js"></script>
</head>
<body>
<!--[if lte IE 7 ]><div id="IE7"><![endif]-->
<!--[if IE 8 ]><div id="IE8"><![endif]-->
<div id="dokuwiki__site">
<div id="dokuwiki__top" class="dokuwiki site mode_show ">
<!-- ********** HEADER ********** -->
<div id="dokuwiki__header">
<div class="pad group">
<hr class="a11y">
</div>
</div>
<!-- /header -->
<div class="wrapper group">
<!-- ********** CONTENT ********** -->
<div id="dokuwiki__content"><div class="pad group">
<div class="pageId"><span>zh_cn:api:ccpoint</span></div>
<div class="page group">
<!-- wikipage start -->
<!-- TOC START -->
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
<ul class="toc">
<li class="level1"><div class="li"><a href="#ccpoint_ccsize_ccrect_坐标_尺寸_矩形区域">CCPoint, CCSize, CCRect 坐标、尺寸、矩形区域</a></div>
<ul class="toc">
<li class="level2"><div class="li"><a href="#ccpoint_用法">CCPoint 用法</a></div></li>
<li class="level2"><div class="li"><a href="#ccsize_用法">CCSize 用法</a></div></li>
<li class="level2"><div class="li"><a href="#ccrect_用法">CCRect 用法</a></div></li>
</ul></li>
</ul>
</div>
</div>
<!-- TOC END -->
<h1 class="sectionedit1" id="ccpoint_ccsize_ccrect_坐标_尺寸_矩形区域">CCPoint, CCSize, CCRect 坐标、尺寸、矩形区域</h1>
<div class="level1">
<ul>
<li class="level1"><div class="li">CCPoint 由 x, y 坐标值组成。</div>
</li>
<li class="level1"><div class="li">CCSize 由宽度和高度两个数值组成。</div>
</li>
<li class="level1"><div class="li">CCRect 由 CCPoint 和 CCSize 两个对象组成。</div>
</li>
</ul>
<p>
~
</p>
</div>
<h2 class="sectionedit2" id="ccpoint_用法">CCPoint 用法</h2>
<div class="level2">
<pre class="code lua"><span class="co1">-- 创建 CCPoint 对象</span>
<span class="kw1">local</span> point <span class="sy0">=</span> CCPoint<span class="br0">(</span><span class="nu0">150</span><span class="sy0">,</span> <span class="nu0">200</span><span class="br0">)</span>
<span class="co1">-- 访问 CCPoint 对象的值</span>
<span class="kw3">print</span><span class="br0">(</span>point<span class="sy0">.</span>x<span class="sy0">,</span> point<span class="sy0">.</span>y<span class="br0">)</span> <span class="co1">-- 输出 150, 200</span></pre>
<p>
~
</p>
</div>
<h2 class="sectionedit3" id="ccsize_用法">CCSize 用法</h2>
<div class="level2">
<pre class="code lua"><span class="co1">-- 创建 CCSize 对象</span>
<span class="kw1">local</span> size <span class="sy0">=</span> CCSize<span class="br0">(</span><span class="nu0">200</span><span class="sy0">,</span> <span class="nu0">100</span><span class="br0">)</span>
<span class="co1">-- 访问 CCSize 对象的值</span>
<span class="kw3">print</span><span class="br0">(</span>size<span class="sy0">.</span>width<span class="sy0">,</span> size<span class="sy0">.</span>height<span class="br0">)</span> <span class="co1">-- 输出 200, 100</span></pre>
<p>
~
</p>
</div>
<h2 class="sectionedit4" id="ccrect_用法">CCRect 用法</h2>
<div class="level2">
<pre class="code lua"><span class="co1">-- 创建 CCRect 对象</span>
<span class="kw1">local</span> rect <span class="sy0">=</span> CCRect<span class="br0">(</span><span class="nu0">50</span><span class="sy0">,</span> <span class="nu0">100</span><span class="sy0">,</span> <span class="nu0">200</span><span class="sy0">,</span> <span class="nu0">300</span><span class="br0">)</span>
<span class="co1">-- 访问 CCRect 对象的值</span>
<span class="kw3">print</span><span class="br0">(</span>rect<span class="sy0">.</span>origin<span class="sy0">.</span>x<span class="sy0">,</span> rect<span class="sy0">.</span>origin<span class="sy0">.</span>y<span class="sy0">,</span> rect<span class="sy0">.</span>size<span class="sy0">.</span>width<span class="sy0">,</span> rect<span class="sy0">.</span>size<span class="sy0">.</span>height<span class="br0">)</span> <span class="co1">-- 输出 50, 100, 200, 300</span></pre>
</div>
<!-- wikipage stop -->
</div>
<div class="docInfo">zh_cn/api/ccpoint.txt · Last modified: 2013/08/19 05:54 by Yu Lei Liao</div>
</div></div>
<!-- /content -->
<hr class="a11y">
<!-- PAGE ACTIONS -->
<div id="dokuwiki__pagetools">
<h3 class="a11y">Page Tools</h3>
<div class="tools">
<ul>
<li>
<a href="index.html" class="action backlink" rel="nofollow" title="home">
<span>home</span>
</a>
</li>
<li>
<a href="#dokuwiki__top" class="action top" accesskey="t" rel="nofollow" title="Back to top [T]">
<span>Back to top</span>
</a>
</li>
</ul>
</div>
</div>
</div>
<!-- /wrapper -->
</div>
</div>
<!-- /site -->
<div class="no">
<img src="zh_cn_api%20%5Bquick-cocos2d-x%20docs%5D_files/indexer.gif" alt="" height="1" width="2">
</div>
<div id="screen__mode" class="no"></div>
<!--[if ( lte IE 7 | IE 8 ) ]></div><![endif]-->
</body>
</html>