Index.html
This article is about the index.html file located in the mygame folder, along with mygame.js; the other index.html file is explained in another article.
本文介绍的是位于 mygame 文件夹中,与 mygame.js 一起的 index.html 文件;另一个 index.html 文件在另一篇文章中说明。
You can open your game using this index.html file or the other index.html file (covered in another article).
您可以通过这个 index.html 文件或另一个 index.html 文件(在另一篇文章中介绍)来打开您的游戏。
In this index.html file, you can customize the title that appears when you open your game, you can add an author, you can change the text displayed at the bottom of the screen, you can change the text that displays when and if javascript or the cookies are disabled for that browser (the ChoiceScript games need to cookies enabled to work) and here you can add/remove stats buttons (more thoroughly explained in another article). You can also change the description the search engines will see if your game is published on an website.
在这个 index.html 文件中,您可以自定义打开游戏时显示的标题,可以添加作者信息,可以更改屏幕底部显示的文本,可以调整当浏览器禁用 JavaScript 或 Cookie 时显示的提示信息(ChoiceScript 游戏需要启用 Cookie 才能运行),并且您可以在此添加/移除 状态按钮(另一篇文章中有更详细的说明)。您还可以修改搜索引擎在您的游戏发布到网站上时看到的描述信息。
Firstly of all, open the index.html file with a text editor. Notepad is a rudimentary text editor, but it's recommended that you use Notepad++, or another advanced text editor.
首先,使用文本编辑器打开 index.html 文件。记事本是一个基础的文本编辑器,但建议您使用 Notepad++ 或其他高级文本编辑器。
Customizing the game's title 自定义游戏标题
You need to look for these two lines (which will not be near each other): 你需要找到这两行代码(它们不会紧挨着出现):
<div id="header"><h1 class="gameTitle">My First ChoiceScript Game</h1>and 和
<title>Multiple Choice Example Game | My First ChoiceScript Game</title>The first controls what is displayed on the page itself, while the second controls what the web browser calls the game. All you need to do is replace the "My First ChoiceScript Game" and "Multiple Choice Example Game | My First ChoiceScript Game" text with the title you want your game to have.
第一行控制页面本身显示的内容,而第二行控制网页浏览器如何称呼你的游戏。你只需要将 "My First ChoiceScript Game" 和 "Multiple Choice Example Game | My First ChoiceScript Game" 这两处文本替换为你希望游戏拥有的标题即可。
Adding an author to your game 为你的游戏添加作者
Right under the first of the above two lines, you place another line, similar to it but a little tweaked: 在上述第一行代码的正下方,你需要添加另一行类似的代码,但稍作调整:
<div id="header"><h2 class="gameTitle">by Game Author</h2>Change the "by Game Author" text to your name, your company's name or to whatever else you would like to be displayed as a second header, and that's it.
将 "by Game Author" 这段文字替换为你的姓名、公司名称或任何你希望显示为副标题的内容,这样就完成了。
Customizing the text at the bottom of the screen 自定义屏幕底部的文字
Look for this line (close to the end): 找到这行代码(接近文件末尾):
You can change that to whatever you want, or you can add further lines just after this that will display under it or above it (according to where you want to place them). Here's how you write lines/mails/links: 你可以将其更改为任何你想要的内容,或者你可以在其后(或根据你想放置的位置在其前)添加更多行。以下是编写行/邮件/链接的方法:
In HTML, <p> signifies the beginning of a paragraph, and the </p> signifies the end of it; you can add how many you want, just don't make the page look too full of text (it's entirely up to you, but the less text, the better it looks). For example, you can do this:
在 HTML 中,<p> 表示段落的开始,而 </p> 表示其结束;你可以添加任意多个,只是不要让页面看起来过于充满文字(这完全取决于你,但文字越少,看起来越好)。例如,你可以这样做:
And this text will display in two lines, just as you wrote it. 这段文字将按照你编写的方式显示为两行。
If however you want to add your e-mail, you just have to tweak the line a bit; you change this part: 然而,如果你想添加你的电子邮件,你只需要稍微调整一下这一行;你更改这一部分:
to your email, this way: 发送至您的邮箱,方式如下:
This mail is the mail you will be taken to if you click the link. The following part: 这封邮件是您点击链接后将跳转到的邮件内容。以下部分:
is the text that displays as the clickable link, and you can change it to whatever you want. 是显示为可点击链接的文本,您可以将其更改为任意内容。
If you want to add a link, you can add this line: 如需添加链接,可添加此行:
Changing the text displayed if javascript or cookies are disabled 更改当 JavaScript 或 Cookie 被禁用时显示的文本
You need to look for these lines (right at the end): 您需要查找以下行(位于文件末尾):
Change them as you want; all you have to do is keep the <noscript> and </noscript> tags. You can add lines of text, mails and links as previously stated.
随你心意修改它们;你只需保留 <noscript> 和 </noscript> 标签即可。你可以像之前提到的那样添加文本行、邮件和链接。
Changing the description search engines see 更改搜索引擎看到的描述
You need to look for these lines: 你需要找到这几行:
You can change everything between the <title> and </title> tags, but you have to keep the | bar (the first part is the title, the second part is the subtitle that will be displayed in the search engines). As for the description, you can change everything between the second pair of quotation marks:
你可以修改 <title> 和 </title> 标签之间的所有内容,但必须保留 | 分隔符(第一部分是标题,第二部分是将在搜索引擎中显示的子标题)。至于描述部分,你可以修改第二对引号之间的所有内容:
Try writing a descriptive title and description so that it makes people want to check out your game if it pops out in any of their searches on search engines. 尝试撰写一个描述性的标题和简介,以便当你的游戏出现在搜索引擎的任何搜索结果中时,能吸引人们去查看。