Skip to content

Commit

Permalink
校对:变量函数
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceyase committed Jul 23, 2024
1 parent 31d8161 commit 5774235
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 6 deletions.
1 change: 1 addition & 0 deletions language/zh/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
"Example 2: Listing Emitter Names":"示例2:列出发射器名称",
"Example 2: Negative Length":"示例2:负长度",
"Example 2: Negative Offset & Stride":"示例 2:负偏移量和负偏移量跨步",
"Example 2: Optimised Removal of the Same Variable in Many Items":"示例 2:在多个项中优化删除相同变量",
"Example 2: Playing a sound on an emitter (similar to audio_play_sound_on)":"示例 2:在发射器上播放声音 (类似于 audio_play_sound_on)",
"Example 2: Pretty Print":"示例2:美化输出",
"Example 2: Progressively Drawing a Line":"示例 2:逐步绘制一条线",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"There are also a number of functions that permit you set the properties for an object. It should be noted that any instances of this object that already exist in the room {}may not be affected by these functions{}, but all new instances of this object created in the room will be, so it is recommend that you never change an objects properties when instances of that object are present in the current room.":"还有许多函数允许您设置对象的属性。需要注意的是,房间{}中已存在的此对象的任何实例可能不受这些函数{}的影响,但此对象的所有新实例将在房间中创建,因此建议您在当前房间中存在对象的实例时,不要更改该对象的属性。",
"You can also access information about a base object and use it to dictate behaviors or changes in the game. For example, you can do a check for a parent object ID, and in the following code if an instance with that parent is found you can then check its {}object_index{} to decide what should be done.":"您还可以访问有关基本对象的信息,并使用它来指示游戏中的行为或变化。例如,您可以检查父对象ID,在下面的代码中,如果找到具有该父对象的实例,则可以检查其{}object_index{}决定应该做什么。",
"You can also access information about a base object and use it to dictate behaviours or changes in the game. For example, you can do a check for a parent object ID, and in the following code if an instance with that parent is found you can then check its {}{}object_index{}{} to decide what should be done.":"您还可以访问有关基础对象的信息并使用它来指示游戏中的行为或更改。例如,您可以检查父对象 ID,在下面的代码中,如果找到具有该父对象的实例,您可以检查其 {}{}object_index{}{} 来决定应该执行什么操作。",
"You can also use certain functions to generate events from code from within a specific instance or object. These functions can be very useful, especially when dealing with {}Parents and Children{}, and are outlined in the following section:":"您还可以使用某些函数从特定实例或对象中的代码生成事件。这些函数非常有用,特别是在处理{}父母和子女{}时。并在以下章节中概述",
"You can also use certain functions to generate events from code from within a specific instance or object. These functions can be very useful, especially when dealing with {}Parents and Children{}, and are outlined in the following section:":"你还可以使用某些函数从特定实例或物体内的代码生成事件。这些函数非常有用,特别是在处理 {}父物体和子物体{} 时,具体内容将在以下部分进行说明",
"{}GameMaker{} gives you a number of functions that permit you to get various details about an object. Note, an object is {}not{} an instance (an in-game entity), it is purely a resource from which all instances are created. This means that the return values of these functions may be different to the actual values shown by instances in the room, as once an instance is created it can be changed through code and GML Visual actions.":"{}GameMaker{}为您提供了许多函数,允许您获取有关对象的各种详细信息。注意,对象是{}而不是{}实例(游戏中的实体),它纯粹是创建所有实例的资源。这意味着这些函数的返回值可能与房间中的实例所显示的实际值不同,因为一旦创建了实例,就可以通过代码和GML视觉动作来更改它。",
"{}GameMaker{} gives you a number of functions that permit you to get various details about an object. Note, an object is {}not{} an instance (an in-game entity), it is purely a resource from which all instances are created. This means that the return values of these functions may be different to the actual values shown by instances in the room, as once an instance is created it can be changed through code and {}GML Visual{} actions.":"{}GameMaker{} 为您提供了许多函数,允许您获取有关对象的各种详细信息。请注意,对象 {} 不是 {} 实例 (游戏内实体),它纯粹是创建所有实例的资源。这意味着这些函数的返回值可能与房间中的实例显示的实际值不同,因为实例创建后就可以通过代码和 {}GML Visual{} 操作进行更改。",
"{}IMPORTANT!{} Changing anything about an object will {}not{} change any instances currently present in the room, only those that are created after the change.":"{}重要!{}更改对象的任何内容{}都不会{}更改房间中当前存在的任何实例,只会更改更改后创建的实例。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
"Rollback Multiplayer":"滚动多人游戏",
"Strings":"字符串",
"This section of the manual is a reference guide for the {}GameMaker{} Language (GML). You can find all the available functions documented here along with the required arguments and examples of code to show how they can be used. For information on how to use GML please see the {}GML Overview{}{} section of the manual.{}":"本手册的这一部分是 {}GameMaker{} 语言 (GML) 的参考指南。您可以找到此处记录的所有可用函数以及所需的参数和代码示例,以展示如何使用它们。有关如何使用 GML 的信息,请参阅手册的 {}GML 概述 {}{} 部分。{}",
"This section of the manual is a reference guide for the {}GameMaker{} Language ({}GML Code{}). You can find all the available functions documented here along with the required arguments and examples of code to show how they can be used. For information on how to use {}GML Code{} please see the {}GML Code Overview{} section of the manual.":"本手册的这一部分是 {}GameMaker{} 语言({}GML Code{})的参考指南。你可以在这里找到所有可用函数的文档,包括所需的参数和示例代码,以展示如何使用它们。有关如何使用 {}GML Code{} 的信息,请参见手册中的 {}GML Code Overview{} 部分。",
"Time Sources":"时间源",
"Variable Functions":"变量函数",
"Web And HTML5":"Web 和 HTML5",
"{}GML Code{} Reference":"{}GML代码{}参考",
"{}NOTE{} Anywhere the manual has \"N/A\" as a return value for a function, it means that the function is not meant to return any value as part of its operation. If you try to check for a return value from these functions then you will get the value {}undefined{}. ":"{}注意{} 任何手册中有“ N/A”作为函数返回值的地方,都意味着该函数不应作为其操作的一部分返回任何值。如果您尝试检查这些函数的返回值,那么您将得到未定义的值{}。",
"{}This section of the manual is a reference guide for the {}{}GameMaker{}{} Language (GML). You can find all the available functions documented here along with the required arguments and examples of code to show how they can be used. For information on how to use GML please see the {} {}GML Overview{}{} section of the manual.{}":"{}本手册的这一部分是{}{}GameMaker{}{}语言 (GML) 的参考指南。您可以找到此处记录的所有可用函数以及所需的参数和代码示例,以显示如何使用它们。有关如何使用GML的信息,请参阅手册的{}{}GML概述{}{}部分。{}",
"{}{}NOTE{}{} Anywhere the manual has \"N/A\" as a return value for a function, it means that the function is not meant to return any value as part of its operation. If you try to check for a return value from these functions then you will get the value {}undefined{}. ":"{}{}注意{}{} 任何手册中有“ N/A”作为函数返回值的地方,都意味着该函数不应作为其操作的一部分返回任何值。如果您尝试检查这些函数的返回值,那么您将得到 {}undefined{} 值。"
"{}{}NOTE{}{} Anywhere the manual has \"N/A\" as a return value for a function, it means that the function is not meant to return any value as part of its operation. If you try to check for a return value from these functions then you will get the value {}undefined{}. ":"{}{}注意{}{} 任何手册中有“ N/A”作为函数返回值的地方,都意味着该函数不应作为其操作的一部分返回任何值。如果您尝试检查这些函数的返回值,那么您将得到 {}undefined{} 值。",
"{}{}NOTE{}{} Anywhere the manual has {}{}N/A{}{} as a return value for a function, it means that the function is not meant to return any value as part of its operation. If you try to check for a return value from these functions then you will get the value {}undefined{}.":"{}{}注意{}{}:在手册中,如果函数的返回值标记为 {}{}N/A{}{},则意味着该函数在操作过程中不打算返回任何值。如果你尝试检查这些函数的返回值,将得到 {}undefined{}。"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"More precisely, this function returns the name of the {}identifier{} that you pass to it; any name to {}identify{} something used in your GML code: an asset name, a variable name, a function name, an enum name, ...":"更准确地说,这个函数返回您传递给它的{}标识符{}的名称;{}标识{}GML代码中使用的任何名称:资产名称、变量名称、函数名称、枚举名称…",
"More precisely, this function returns the name of the {}identifier{} that you pass to it; any name to {}identify{} something used in your GML code: an asset name, a variable name, a function name, the name of an enum (or of one of its members) or a macro name.":"更准确地说,这个函数返回你传递给它的 {}标识符{} 的名称;即在你的 GML 代码中用来 {}识别{} 某些东西的名称:资产名称、变量名称、函数名称、枚举的名称(或其成员的名称)或宏名称。",
"The code above shows a few examples on how to use the {}{}nameof{}{} function. The name of various variables and functions in GML is looked up using the function and output in the debug log using {}{}show_debug_message{}{}.":"上面的代码展示了几个关于如何使用{}{}nameof{}{}函数的示例。GML中各种变量和函数的名称是使用该函数查找的,并使用{}{}show_debug_message{}{}在调试日志中输出。",
"The c{}ode above shows a few{}{}{}{}{}{}{}{} examples {}{}{}on h{}{}{}ow t{}{}{}o use the {}{}nameof{}{} function{}{}{}. The name of various variables and functions in GML is looked up using the function and output in the debug log using {}{}show_debug_message{}{}.{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}":"上面的代码展示了一些关于如何使用{18}{19}nameof{20}{21}函数{22}{23}的{8}示例{9}。使用函数查找GML中各种变量和函数的名称,并使用{26}show_debug_message{27}在调试日志中输出。",
"The variable of which to get the name":"要获取其名称的变量",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
"The above code first creates two constructors: a parent constructor {}item{} with a single static function {}hello{} and a child constructor {}potion{}. It then creates a new {}potion{} and stores it in a variable {}my_potion{}. Next, a call to {}{}static_get{}{} is made to get the static struct of {}my_potion{}. The returned static struct, stored in a temporary variable {}_static_potion{}, is part of the static chain. From this point, all further calls to {}{}static_get{}{} will move up in the static chain. Another call to {}{}static_get{}{} is made, which returns the static of {}item{} and stores it in another temporary variable {}_static_parent{}. Finally, this struct\u0027s {}hello{} method is called.":"上面的代码首先创建两个构造函数:带有单个静态函数 {}hello{} 的父构造函数 {}item{} 和子构造函数 {}potion{}。 然后,它创建一个新的 {}potion{} 并将其存储在变量 {}my_potion{} 中。 接下来,调用 {}{}static_get{}{} 以获取 {}my_potion{} 的静态结构。 返回的静态结构体存储在临时变量 {}_static_potion{} 中,是静态链的一部分。 从此时起,对 {}{}static_get{}{} 的所有进一步调用都将在静态链中向上移动。 再次调用 {}{}static_get{}{},返回 {}item{} 的静态值并将其存储在另一个临时变量 {}_static_parent{} 中。 最后,调用该结构体的 {}hello{} 方法。",
"The static struct for that function is then returned, and stored in a variable ({}_static_counter{}). Then it prints the static variable from the function, by first reading it from the function directly ({}counter.count{}) and then reading it from the static struct ({}_static_counter.count{}). Both print the same value, as they refer to the exact same variable.":"然后返回该函数的静态结构,并将其存储在变量 ({}_static_counter{}) 中。然后,它打印函数中的静态变量,方法是首先直接从函数中读取静态变量 ({}counter.count{}),然后从静态结构中读取它 ({}_static_counter.count{})。两者都打印相同的值,因为它们引用完全相同的变量。",
"The struct or function for which to get the static struct":"要获取其静态结构的结构或函数",
"The struct, function or method for which to get the static struct":"要获取静态结构体的结构体、函数或方法",
"This function returns the static struct for the given function or struct.":"此函数返回给定函数或结构的静态结构。",
"This function returns the static struct for the given function, or {}undefined{} if it has no static. The static struct is where all static variables for a function are stored.":"此函数 返回给定函数的静态结构,如果没有静态结构,则返回 {}undefined{}。静态结构是存储函数的所有静态变量的地方。",
"This function returns the {}Static Struct{} for the given function or struct.":"该函数返回给定函数或结构体的 {}静态结构体{}。",
"When using constructor inheritance, static structs are chained, i.e. you can get the static struct of a static struct, if the constructor has a parent constructor.":"在使用构造函数继承时,静态结构是链接的,也就是说,如果构造函数有父构造函数,则可以获得静态结构的静态结构。",
"When you supply a function or method, this function returns the static struct for that function or method.":"当你提供一个函数或方法时,该函数返回该函数或方法的静态结构体。",
"When you supply a function, this function returns the static struct for the function.":"当您提供函数时,此函数返回该函数的静态结构。",
"You can also supply a struct, in which case it will give you the static struct for the constructor that was used to create the struct (or it may be a different struct if it was changed using {}{}static_set{}{}).":"您还可以提供一个结构,在这种情况下,它将为您提供用于创建该结构的构造函数的静态结构 (或者,如果它是使用 {}{}static_set{}{} 更改的,则它可能是一个不同的结构)。",
"You can also supply a struct. What\u0027s returned depends on the struct: ":"你也可以提供一个结构体。返回的内容取决于结构体:"
"You can also supply a struct. What\u0027s returned depends on the struct: ":"你也可以提供一个结构体。返回的内容取决于结构体:",
"{}{}NOTE{}{} You can pass the result of {}{}method_get_index{}{} to get the static struct of a method\u0027s function.":"{}{}注意{}{}:你可以将 {}{}method_get_index{}{} 的结果传递给该函数,以获取方法的静态结构体。",
"{}{}Struct{}{} or {}{}undefined{}{} (for the root struct)":"{}{}结构体{}{} 或 {}{}undefined{}{}(用于根结构体)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"The above code first creates two structs that store a point. Next, it gets the hash of the variable name \"z\" using {}{}variable_get_hash{}{}. After that, it checks both structs using {}{}struct_exists_from_hash{}{} to see if the variable exists. Finally, a debug message is shown for each of the structs.":"上述代码首先创建了两个存储点的结构体。接着,它使用 {}{}variable_get_hash{}{} 获取变量名称 \"z\" 的哈希值。之后,它使用 {}{}struct_exists_from_hash{}{} 检查这两个结构体以查看变量是否存在。最后,为每个结构体显示调试信息。",
"The hash value referring to the variable (as returned by {}{}variable_get_hash{}{})":"指向变量的哈希值(由 {}{}variable_get_hash{}{} 返回)",
"The struct to check":"要检查的结构体",
"This function returns whether the variable, referred to by the hash, exists in the given struct or not.":"此函数返回哈希所引用的变量是否存在于给定结构体中。",
"You can retrieve the hash of a variable using {}{}variable_get_hash{}{}.":"你可以使用 {}{}variable_get_hash{}{} 来检索变量的哈希值。"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"The above code creates a temporary struct {}_the_struct{} with three member variables: {}a{}, {}b{} and {}c{}. It then gets the hash of a variable {}a{}. This hash is then used in {}{}struct_get_from_hash{}{} to retrieve the value of the struct member with the corresponding name. The returned value is assigned to another temporary variable {}_value{}.":"上面的代码创建了一个具有三个成员变量的临时结构{}_the_struct{}:{}a{}、{}b{}和{}c{}。然后,它获得变量 {}a{} 的散列。然后在 {}{}struct_get_from_hash{}{} 中使用此散列来检索具有相应名称的结构成员的值。返回值被赋给另一个临时变量 {}_value{}。",
"The hash of the variable to get (as returned by {}{}variable_get_hash{}{})":"要获取的变量的哈希(由 {}{}variable_get_hash{}{} 返回)",
"The struct reference to use":"要使用的结构引用",
"This function gets the value of a struct member using the hash returned by {}{}variable_get_hash{}{}.":"此函数使用 {}{}variable_get_hash{}{} 返回的散列获取结构成员的值。"
"This function gets the value of a struct member using the hash returned by {}{}variable_get_hash{}{}.":"此函数使用 {}{}variable_get_hash{}{} 返回的散列获取结构成员的值。",
"{}{}NOTE{}{} The compiler automatically replaces variable names that it detects cannot ever change while your game is running (i.e. they are {}constant at compile time{}) with their hash value. It can be useful to get the hash yourself if you only know the name of the variable that\u0027s accessed while your game is running (i.e. {}at runtime{}). See {}Compiler Optimisations{}.":"{}{}注意{}{}:编译器会自动将其检测到在游戏运行期间不会发生变化的变量名称(即,它们在编译时是 {}常量{})替换为它们的哈希值。如果你只知道游戏运行时访问的变量的名称(即 {}运行时{}),获取哈希值可能会很有用。请参见 {}编译器优化{}。"
}
Loading

0 comments on commit 5774235

Please sign in to comment.