44 < meta charset ="UTF-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
66 < title > NovaFlare Engine | HScript 开发文档</ title >
7- < link rel ="stylesheet " href ="css/themes.css ">
8- < link rel ="stylesheet " href ="css/styles.css ">
7+ < link rel ="stylesheet " href ="../../../../ css/themes.css ">
8+ < link rel ="stylesheet " href ="../../../../ css/styles.css ">
99 < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css ">
1010 < link rel ="preconnect " href ="https://fonts.googleapis.com ">
1111 < link rel ="preconnect " href ="https://fonts.gstatic.com " crossorigin >
@@ -203,51 +203,15 @@ <h1 data-en="NovaFlare Engine" data-zh="新星闪耀引擎">新星闪耀引擎</
203203
204204 < main class ="docs-main ">
205205 < div class ="container ">
206- <!-- 大标题 -->
207- < h1 class ="section-title " data-en ="HScript Development Documentation " data-zh ="HScript 开发文档 "> HScript 开发文档</ h1 >
208-
209- <!-- 小标题 -->
210- < p class ="section-subtitle " data-en ="Complete guide for HScript scripting in NovaFlare Engine " data-zh ="NovaFlare Engine 中 HScript 脚本的完整指南 "> NovaFlare Engine 中 HScript 脚本的完整指南</ p >
211-
212206 < div class ="docs-container ">
213- <!-- 侧边栏 - Haxe官网风格 -->
214207 < aside class ="sidebar ">
215208 < div class ="sidebar-section active ">
216209 < div class ="sidebar-header ">
217- < span > < i class ="fas fa-code me-2 "> </ i > 基础语法</ span >
218- < i class ="fas fa-chevron-right "> </ i >
219- </ div >
220- < div class ="sidebar-items ">
221- < a href ="#variables " class ="sidebar-item "> 变量与数据类型</ a >
222- < a href ="#functions " class ="sidebar-item "> 函数定义</ a >
223- < a href ="#control-flow " class ="sidebar-item "> 控制流程</ a >
224- < a href ="#events " class ="sidebar-item "> 事件处理</ a >
225- </ div >
226- </ div >
227-
228- < div class ="sidebar-section ">
229- < div class ="sidebar-header ">
230- < span > < i class ="fas fa-cube me-2 "> </ i > 核心API</ span >
231- < i class ="fas fa-chevron-right "> </ i >
232- </ div >
233- < div class ="sidebar-items ">
234- < a href ="#createSprite " class ="sidebar-item active "> createSprite()</ a >
235- < a href ="#playSound " class ="sidebar-item "> playSound()</ a >
236- < a href ="#loadAsset " class ="sidebar-item "> loadAsset()</ a >
237- < a href ="#addEventListener " class ="sidebar-item "> addEventListener()</ a >
238- </ div >
239- </ div >
240-
241- < div class ="sidebar-section ">
242- < div class ="sidebar-header ">
243- < span > < i class ="fas fa-gamepad me-2 "> </ i > 游戏功能</ span >
210+ < span > < i class ="fas fa-code me-2 "> </ i > 抽屉标题</ span >
244211 < i class ="fas fa-chevron-right "> </ i >
245212 </ div >
246213 < div class ="sidebar-items ">
247- < a href ="#animation " class ="sidebar-item "> 动画系统</ a >
248- < a href ="#physics " class ="sidebar-item "> 物理引擎</ a >
249- < a href ="#ui " class ="sidebar-item "> 用户界面</ a >
250- < a href ="#input " class ="sidebar-item "> 输入处理</ a >
214+ < a href ="#variables " class ="sidebar-item "> 抽屉物件名称</ a >
251215 </ div >
252216 </ div >
253217 </ aside >
@@ -257,36 +221,24 @@ <h1 class="section-title" data-en="HScript Development Documentation" data-zh="H
257221 <!-- 函数文档模板 -->
258222 < div class ="doc-section " id ="createSprite ">
259223 <!-- 函数名称 -->
260- < h2 data-en ="Function: createSprite () " data-zh ="函数: createSprite () "> 函数: createSprite ()</ h2 >
261- < div class ="function-name "> createSprite(x:Float, y:Float, ?graphic:GraphicAsset):Sprite </ div >
224+ < h2 data-en ="trace () " data-zh ="() "> trace ()</ h2 >
225+ < div class ="function-name "> trace(Text:String) </ div >
262226
263227 <!-- 函数解释 -->
264228 < div class ="function-explanation ">
265- < p data-en ="Creates a new sprite object at the specified position with an optional graphic asset. "
266- data-zh ="在指定位置创建一个新的精灵对象,可选择性地指定图形资源。 ">
267- 在指定位置创建一个新的精灵对象,可选择性地指定图形资源。
268- </ p >
269- < p data-en ="This function is the primary method for creating visual elements in NovaFlare Engine. It returns a Sprite object that can be added to the display list and manipulated through various properties and methods. "
270- data-zh ="这是NovaFlare Engine中创建视觉元素的主要方法。它返回一个Sprite对象,可以添加到显示列表并通过各种属性和方法进行操作。 ">
271- 这是NovaFlare Engine中创建视觉元素的主要方法。它返回一个Sprite对象,可以添加到显示列表并通过各种属性和方法进行操作。
229+ < p data-en ="Print a string of text on the console. "
230+ data-zh ="在控制台打印一串文本 ">
231+ 在控制台打印一串文本
272232 </ p >
273233 </ div >
274234
275235 <!-- 函数注意事项 -->
276236 < div class ="function-notes ">
277237 < h3 data-en ="Notes " data-zh ="注意事项 "> 注意事项</ h3 >
278238 < ul >
279- < li data-en ="The sprite will not be visible until added to a display object container. "
280- data-zh ="精灵在添加到显示对象容器之前不会可见。 ">
281- 精灵在添加到显示对象容器之前不会可见。
282- </ li >
283- < li data-en ="If no graphic is provided, the sprite will be created as an empty container. "
284- data-zh ="如果没有提供图形资源,精灵将创建为空容器。 ">
285- 如果没有提供图形资源,精灵将创建为空容器。
286- </ li >
287- < li data-en ="Coordinates are relative to the parent container's coordinate system. "
288- data-zh ="坐标相对于父容器的坐标系。 ">
289- 坐标相对于父容器的坐标系。
239+ < li data-en ="Nothing "
240+ data-zh ="啥也没有 ">
241+ 啥也没有
290242 </ li >
291243 </ ul >
292244 </ div >
@@ -299,64 +251,8 @@ <h3 data-en="Example Usage" data-zh="使用示例">使用示例</h3>
299251 < span > HScript</ span >
300252 < button class ="code-copy " data-en ="Copy " data-zh ="复制 "> 复制</ button >
301253 </ div >
302- < pre > < code class ="language-javascript "> // 创建一个位于屏幕中央的精灵
303- var playerSprite = createSprite(400, 300, "assets/images/player.png");
304-
305- // 设置精灵属性
306- playerSprite.scaleX = playerSprite.scaleY = 0.5;
307- playerSprite.alpha = 0.8;
308-
309- // 将精灵添加到舞台
310- addChild(playerSprite);
311-
312- // 为精灵添加动画
313- playerSprite.animation.add("walk", [0, 1, 2, 3], 10, true);
314- playerSprite.animation.play("walk");</ code > </ pre >
315- </ div >
316- </ div >
317- </ div >
318-
319- <!-- 第二个函数示例 -->
320- < div class ="doc-section " id ="playSound ">
321- < h2 data-en ="Function: playSound() " data-zh ="函数: playSound() "> 函数: playSound()</ h2 >
322- < div class ="function-name "> playSound(soundId:String, ?volume:Float = 1.0, ?looped:Bool = false):SoundChannel</ div >
323-
324- < div class ="function-explanation ">
325- < p data-en ="Plays a sound effect or music track with specified parameters. "
326- data-zh ="播放音效或音乐轨道,可指定参数。 ">
327- 播放音效或音乐轨道,可指定参数。
328- </ p >
329- </ div >
330-
331- < div class ="function-notes ">
332- < h3 data-en ="Notes " data-zh ="注意事项 "> 注意事项</ h3 >
333- < ul >
334- < li data-en ="Sound must be preloaded using the asset loading system. "
335- data-zh ="声音必须使用资源加载系统预先加载。 ">
336- 声音必须使用资源加载系统预先加载。
337- </ li >
338- < li data-en ="Volume range is 0.0 (silent) to 1.0 (full volume). "
339- data-zh ="音量范围是0.0(静音)到1.0(最大音量)。 ">
340- 音量范围是0.0(静音)到1.0(最大音量)。
341- </ li >
342- </ ul >
343- </ div >
344-
345- < div class ="function-example ">
346- < h3 data-en ="Example Usage " data-zh ="使用示例 "> 使用示例</ h3 >
347- < div class ="code-block ">
348- < div class ="code-header ">
349- < span > HScript</ span >
350- < button class ="code-copy " data-en ="Copy " data-zh ="复制 "> 复制</ button >
351- </ div >
352- < pre > < code class ="language-javascript "> // 播放跳跃音效
353- var jumpSound = playSound("jump", 0.7);
354-
355- // 播放背景音乐(循环)
356- var bgMusic = playSound("bgm_main", 0.5, true);
357-
358- // 停止背景音乐
359- bgMusic.stop();</ code > </ pre >
254+ < pre > < code class ="language-javascript ">
255+ trace("fuckyou")</ code > </ pre >
360256 </ div >
361257 </ div >
362258 </ div >
@@ -371,10 +267,10 @@ <h3 data-en="Example Usage" data-zh="使用示例">使用示例</h3>
371267 < p > NovaFlare Engine Development Documentation</ p >
372268 </ div >
373269 < ul class ="footer-links ">
374- < li > < a href ="../index.html " data-en ="Home " data-zh ="首页 "> 首页</ a > </ li >
375- < li > < a href ="# docs-selection " data-en ="Documentation " data-zh ="文档 "> 文档</ a > </ li >
376- < li > < a href ="../index.html#download " data-en ="Download " data-zh ="下载 "> 下载</ a > </ li >
377- < li > < a href ="../index.html#community " data-en ="Community " data-zh ="社区 "> 社区</ a > </ li >
270+ < li > < a href ="../../ index.html " data-en ="Home " data-zh ="首页 "> 首页</ a > </ li >
271+ < li > < a href ="../../ docs-choose.html " data-en ="Documentation " data-zh ="文档 "> 文档</ a > </ li >
272+ < li > < a href ="../../ index.html#download " data-en ="Download " data-zh ="下载 "> 下载</ a > </ li >
273+ < li > < a href ="../../ index.html#community " data-en ="Community " data-zh ="社区 "> 社区</ a > </ li >
378274 </ ul >
379275 < div class ="footer-social ">
380276 < a href ="https://discord.gg/FkEwvRW2YZ " target ="_blank " aria-label ="Discord "> < i class ="fab fa-discord "> </ i > </ a >
0 commit comments