版本 Diff 差异对比
条目:界面修改 · 对比历史版本与当前版本间的真实 Wikitext 差异
+225 行新增-207 行移除
历史基准版本Rev #28802
文本替换 - 替换「[[Category:Modding]]」为「[[Category:改派教程]]」
Pokewiz2017-12-18 02:01:41
当前最新版本Rev #103778
fixedsize用法翻译反了
鞠泽柳2024-10-25 01:00:36
Wikitext 语法逐行变动
当前版本新增历史版本移除
- In Europa Universalis IV, the interface refers to the user interface the player uses to interact with the game.
+ {{Version|长期有效}}
+ 在欧陆风云4中, 界面是指玩家用来与游戏进行交互的各种界面,如事件框、外交界面、宗教界面等都属于界面的范围。
== Overview ==
- The components of an interface file can be broken into two groups: containers and elements. For example, ''windowType'' is a container, whereas ''iconType'' is an element.
+ 界面文件是由两部分内容组成的,这两部分内容分别是'''container'''和'''elements'''。
- An interface file uses the '''.gui''' filetype. All interface files are found in {{path|interface/}}.
+ 例如:'''windowType'''是一个'''container''',而'''iconType'''是一个'''elements'''。
- When ''internal'' is used here, it is referring to the source code that only Paradox can edit. In short, it means the subject it refers to is not modifiable.
+ 界面文件被定义为'''.gui'''这一文件类型。所有的界面文件都可以在{{path|interface/}}目录中找到。
+ 界面文件中使用的'''internal'''指的是只有Paradox(P社)才能编辑的源代码。简而言之,这意味着它所指的对象是不可以被随意修改的。
+
== Containers ==
- Containers are used to group together elements and associate them with an internal function.
+ '''container'''是定义为:将诸多'''elements'''进行组合并将它们以'''internal'''代码相关联的界面组成部分。
- You cannot add new containers except in some very specific circumstances. This is because the ''name'' attribute of a container is linked internally to whatever data the container requires. The exceptions are for Ages in ''ages_view.gui'', where you can add new containers for custom Ages and for custom technology tables in ''countrytechnologyview.gui''.
+ 除非是在某些非常特殊的情况下才可以添加新的'''container''',否则'''container'''是无法被自定义的。
- The order and nesting of container definitions affects how they are displayed.
+ 这是因为'''container'''的'''name'''属性在界面文件中的'''internal'''代码中都有特定的关联关系,换言之每一个不同的'''name'''都与特定的内核机制有关。
- For example, ''countryreligionview'' in ''countryreligionview.gui'' contains all the specific containers for each religion mechanic. Nested within, ''orthodox_specific_window'' is a container for the Orthodox interface. Below this is the ''muslim_specific_window'', which is a container for the Piety interface.
+ 例外情况是{{path|interface/ages_view.gui}}中的'''age'''属性,
- Therefore, if you added both mechanics to a religion, you as a player would only see the Orthodox interface.
+ 您可以为{{path|interface/countrytechnologyview.gui}}文件中的自定义'''age'''属性和自定义科技表属性添加新的'''container'''。
+ 通过定义'''container'''的排列顺序和嵌套方式会影响'''container'''的显示方式。
+
+ 例如:'''countryreligionview'''在{{path|interface/countryreligionview.gui}}中定义了对所有宗教能力的'''container'''。
+
+ 如果将作为宗教能力嵌套方式应用的'''orthodox_specific_window''' 即东正教圣像界面的'''container'''
+
+ 和在其排列顺序之后的'''muslim_specific_window'''即穆斯林虔诚界面的'''container'''这两种机制都加入到同一新建宗教中。
+
+ 那么,作为玩家的我们将只能看到东正教的圣像界面而无法看到穆斯林虔诚界面,这就是嵌套方式和排列顺序影响'''container'''显示方式的一个典型案例。
+
== windowType ==
- The most common container type, used to hold any group of elements.
+ 这是最常见的'''container''',可以用于容纳任何种类的'''elements'''。
- The following attributes are commonly used:
- * '''name''' - The container name.
- * '''background''' - An element to use as the container background.
- * '''position''' - The screen position of the container.
- * '''size''' - The bounding box for the container.
- * '''moveable''' - Sets whether the container can be dragged around.
- * '''fullscreen''' - Sets whether the container is considered to obscure the whole screen.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义'''container'''的命名。
+ * '''background''' - 用于定义作为'''container'''背景的'''elements'''。
+ * '''position''' - 用于定义'''container'''的屏幕放置位置。
+ * '''size''' - 用于定义'''container'''的边框大小。
+ * '''moveable''' - 用于设置'''container'''是否可以拖动。
+ * '''fullscreen''' - 用于设置'''container'''是否可以模糊整个屏幕。
+ * '''orientation''' - 用于设置'''position'''属性的坐标原点。
- The following attributes are used for animated containers:
- * '''show_position''' - The screen position the container moves to in ''show'' mode.
- * '''hide_position''' - The screen position the container moves to in ''hide'' mode.
- * '''animation_type''' - The animation type used to move the container (always ''decelerated'').
- * '''animation_time''' - The animation time (always ''300'').
- * '''upsound''' - The sound to play when container moves to ''show'' position.
- * '''downsound''' - The sound to play when container moves to ''hide'' position.
+ 下列属性是应用在动画'''container'''之中的:
+ * '''show_position''' - 用于定义'''container'''在'''显示'''模式下移动到的屏幕位置。
+ * '''hide_position''' - 用于定义'''container'''在'''隐藏'''模式下移动到的屏幕位置。
+ * '''animation_type''' - 用于定义移动'''container'''应用的动画类型 (通常为'''减速''')。
+ * '''animation_time''' - 用于定义动画的移动速度(通常为'''300''')。
+ * '''upsound''' - 用于定义'''container'''移动到'''显示'''位置时播放的声音。
+ * '''downsound''' - 用于定义'''container'''移动到'''隐藏'''位置时播放的声音。
- The following attributes are rarely or never used:
- * '''dontRender'''
- * '''horizontalBorder'''
- * '''verticalBorder'''
+ 下列属性是几乎从未使用过的
+ * '''dontRender'''- 用于定义'''container'''禁止渲染。
+ * '''horizontalBorder''' - 用于定义'''container'''的水平边界。
+ * '''verticalBorder''' - 用于定义'''container'''的垂直边界。
== scrollbarType ==
- The '''scrollbarType''' is used to define which elements a scrollbar is composed of.
+ '''scrollbarType''' 用于定义滚动条由哪些'''elements'''组成。
- The following attributes are used:
- * '''name''' - The scrollbar name.
- * '''slider''' - The button element to use as the scrollbar slider.
- * '''track''' - The button element to use as the scrollbar tracker.
- * '''leftbutton''' - The button element to use as the scrollbar left increment button.
- * '''rightbutton''' - The button element to use as the scrollbar right increment button.
- * '''position''' - The screen position of the scrollbar.
- * '''size''' - The bounding box for the scrollbar.
- * '''priority''' - The priority the scrollbar has over other elements.
- * '''borderSize''' - The bounding box for border of the scrollbar.
- * '''maxValue''' - The maximum value the scrollbar moves to (used to control the increments).
- * '''minValue''' - The minimum value the scrollbar moves to (used to control the increments).
- * '''stepSize''' - The size of increments using the increment button.
- * '''startValue''' - The initial size the slider for the scrollbar starts at.
- * '''horizontal''' - Sets whether the scrollbar is horizontal (1) or vertical (0).
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义滚动条的名称。
+ * '''slider''' - 用于定义滚动条的滑块'''slider'''。
+ * '''track''' - 用于定义滚动条的跟踪器'''tracker'''。
+ * '''leftbutton''' - 用于定义滚动条的左侧增量按钮。
+ * '''rightbutton''' - 用于定义滚动条右侧增量按钮。
+ * '''position''' - 用于定义滚动条的屏幕放置位置。
+ * '''size''' - 用于定义滚动条的尺寸大小。
+ * '''priority''' - 用于定义滚动条相对于其他'''elements'''的优先级。
+ * '''borderSize''' - 用于定义滚动条的边框范围。
+ * '''maxValue''' - 用于定义滚动条移动的最大值 (用于控制增量)。
+ * '''minValue''' - 用于定义滚动条移动的最小值 (用于控制增量)。
+ * '''stepSize''' - 用于定义使用增量按钮导致增量变化的数值。
+ * '''startValue''' - 用于定义滚动条的初始数值。
+ * '''horizontal''' - 用于定义滚动条是水平还是垂直的,1为水平,0为垂直。
== Elements ==
- There are multiple element types used within containers. All elements must be used within containers, they will not work outside of one.
+ '''Elements'''中定义了'''elements'''内容。所有'''elements'''都必须在'''Elements'''中使用,在此之外将不生效!
- Elements will inherit the orientation of the containers they are located in unless the orientation is specified for the element itself.
+ '''elements'''将继承所在'''container'''的基本内容,除非是为'''elements'''指定了具体内容。
- The following elements do not rely on internal code, and can be freely added:
- * '''iconType''' - Used for static images.
- * '''instantTextBoxType''' - Used for text.
+ 以下'''elements'''不依赖'''internal'''代码,可以自由添加:
+ * '''iconType''' - 用于定义图标。
+ * '''instantTextBoxType''' - 用于定义文本。
- The following elements do rely on internal code. You can add new elements, but they will not be populated with data, making such usage very limited.
- * '''guiButtonType''' - Used for buttons.
- * '''smoothListboxType''' - Used for smooth scrollable lists.
- * '''listboxType''' - Used for scrollable lists.
- * '''checkboxType''' - Used for checkboxes.
- * '''OverlappingElementsBoxType''' - Used for overlapping many elements.
- * '''editBoxType''' - Used for editable textboxes.
- * '''shieldtype''' - Used for to display country flags.
+ 以下'''elements'''则非常依赖于'''internal'''代码。虽然您可以添加新'''elements''',但新加的'''elements'''不会被添加到'''container'''中也无法生效。
+ * '''guiButtonType''' - 用于定义按钮。
+ * '''smoothListboxType''' - 用于定义平滑列表框。
+ * '''listboxType''' - 用于定义列表框。
+ * '''checkboxType''' - 用于定义复选框。
+ * '''OverlappingElementsBoxType''' - 用于重叠'''elements'''。
+ * '''editBoxType''' - 用于定义可编辑文本框。
+ * '''shieldtype''' - 用于定义国旗。
- The following elements are legacy:
- * '''textBoxType''' - Same as ''instantTextBoxType''.
- * '''eu3dialogtype''' - Same as ''windowType''.
- * '''shieldtype''' - Only used within ''eu3dialogtype''. Different elements are used for flags in more recent files.
+ 以下'''elements'''是遗留内容:
+ * '''textBoxType''' - 现在等同于'''instantTextBoxType'''。
+ * '''eu3dialogtype''' - 现在等同于'''windowType'''。
+ * '''shieldtype''' - 仅仅用于'''eu3dialogtype'''。在最近越来越多的文件中,许多不同的'''elements'''都被用于'''flag'''
== iconType ==
- The ''iconType'' element is used to add images to the interface. It's usage overlaps with ''guiButtonType'', which is similar but operates as a button.
+ '''iconType'''中的'''elements'''用于向界面增加'''图标'''贴图.它的用法与'''guiButtonType'''基本相同,但后者用于定义'''按钮'''贴图。
- The following attributes are used:
- * '''name''' - The icon name.
- * '''position''' - The screen position of the icon.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
- * '''spriteType''' - The image to use for the icon. Refers to a ''spriteType'' definition.
- * '''quadTextureSprite''' - The image to use for the icon. Refers to a dynamic ''spriteType'' definitions (i.e. flags) or multi-frame ''spriteType'' definitions.
- * '''frame''' - Which frame to use for the icon when using a multi-frame image.
- * '''alwaystransparent''' - Forces the icon to allow click through, i.e. clicking on an element behind another element.
- * '''hint_tag''' - Set the hint key the icon uses to display a hint tooltip with when hovered over.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义图标的命名。
+ * '''position''' - 用于定义图标的屏幕放置位置
+ * '''orientation''' - 用于定义'''position'''属性的坐标原点。
+ * '''spriteType''' - 用于定义图标贴图,这指向的是'''spriteType'''中定义的内容。
+ * '''quadTextureSprite''' - 用于定义图标贴图。这指向的是动态'''spriteType'''中定义的内容(即'''标志''')或者多帧'''spriteType'''中定义的内容。
+ * '''frame''' - 用于定义使用多帧贴图时,图标应当使用第几帧贴图。
+ * '''alwaystransparent''' - 用于定义图标是否允许点击,即点击'''elements'''后可以再点击'''elements'''。
+ * '''hint_tag''' - 用于设置指针悬停图标时显示提示内容的提示键。
== instantTextBoxType ==
- The ''instantTextBoxType'' element is used to add text to the interface. In some instances, the text for the element is generated internally (i.e. ''regiment_count''). In these instances you cannot edit the text unless it is exposed in an localized string.
+ '''instantTextBoxType'''中的'''elements'''用于向界面增加'''文本'''贴图。
+
+ 这是由于在某些界面文件中的文本是由'''internal'''代码定义的,在这种情况下除非在该处编辑本地化字符串,否则无法进行文本翻译。
- The following attributes are used:
- * '''name''' - The textbox name.
- * '''position''' - The screen position of the textbox.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
- * '''text''' - The text displayed by the textbox.
- * '''font''' - The font to use for the text.
- * '''maxWidth''' - The total width in pixels at which text is displayed.
- * '''maxHeight''' - The total height in pixels at which text is displayed.
- * '''format''' - How the text is aligned.
- * '''fixedsize''' - Whether the textbox should truncate text that exceeds its limits.
- * '''borderSize''' - The bounding box for the border of the textbox.
- * '''alwaystransparent''' - Forces the text to allow click through, i.e. clicking on an element behind another element.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义文本框的命名。
+ * '''position''' - 用于定义文本框的屏幕放置位置。
+ * '''orientation''' - 用于定义'''position'''属性的坐标原点。
+ * '''text''' - 用于定义文本框显示的文本内容。
+ * '''font''' - 用于定义文本框显示的字体内容。
+ * '''maxWidth''' - 用于定义文本框的总宽度,这里是以像素为单位的。
+ * '''maxHeight''' - 用于定义文本框的总高度,这里是以像素为单位的。
+ * '''format''' - 用于定义文本框的对齐方式
+ * '''fixedsize''' - 用于定义文本框是否将超出其限制范围的文本内容删除。
+ * '''borderSize''' - 用于定义文本框的边框范围。
+ * '''alwaystransparent''' - 用于定义文本框是否允许点击,即点击'''elements'''后可以再点击'''elements'''。
- The following attributes are rarely or never used:
- * '''textureFile''' - Never used for anything.
+ 下列属性是几乎从未使用过的:
+ * '''textureFile''' - 请注意!这一条从未被使用过!
- Valid ''format'' values:
+ 有效的'''format'''值:
* left
* centre
* right
== guiButtonType ==
- The ''guiButtonType''' element is used to add buttons to the interface. Buttons are composed of an image and text, so they operate in a similar manner to ''iconType'' and ''instantTextBoxType''.
+ '''guiButtonType'''中的'''elements'''用于向界面增加'''按钮'''贴图。
- The following attributes are used:
- * '''name''' - The button name.
- * '''position''' - The screen position of the button.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
- * '''spriteType''' - The image to use for the button. Refers to a ''spriteType'' definition.
- * '''quadTextureSprite''' - The image to use for the button. Refers to a dynamic ''spriteType'' definitions (i.e. flags) or multi-frame ''spriteType'' definitions.
- * '''frame''' - Which frame to use for the button when using a multi-frame image.
- * '''alwaystransparent''' - Forces the button to allow click through, i.e. clicking on an element behind another element.
- * '''buttonText''' - The text displayed by the button.
- * '''buttonFont''' - The font to display the button text in.
- * '''shortcut''' - The shortcut to add for this button.
- * '''clicksound''' - The sound to use when clicked.
- * '''hint_tag''' - Set the hint key the icon uses to display a hint tooltip with when hovered over.
- * '''pdx_tooltip''' - Set the short tooltip this button uses.
- * '''pdx_tooltip_delayed''' - Set the full tooltip this button uses.
- * '''scale''' - Scales the button size.
+ 按钮可以被定义为'''图像'''和'''文本''',因此它的生效方式类似于'''iconType'''和'''instantTextBoxType'''
- The following attributes are rarely or never used:
- * '''tooltip''' - Never used.
- * '''tooltipText''' - Never used.
- * '''delayedTooltipText''' - Never used.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义按钮的命名。
+ * '''position''' - 用于定义按钮的屏幕放置位置
+ * '''orientation''' - 用于定义'''position'''属性的坐标原点。
+ * '''spriteType''' - 用于定义按钮贴图,这指向的是'''spriteType'''中定义的内容。
+ * '''quadTextureSprite''' - 用于定义按钮贴图。这指向的是动态'''spriteType'''中定义的内容(即'''标志''')或者多帧'''spriteType'''中定义的内容。
+ * '''frame''' - 用于定义使用多帧贴图时,按钮应当使用第几帧贴图。
+ * '''alwaystransparent''' - 用于定义按钮是否允许点击,即点击'''elements'''后可以再点击'''elements'''。
+ * '''buttonText''' - 用于定义按钮显示的文本内容。
+ * '''buttonFont''' - 用于定义按钮显示的字体内容。
+ * '''shortcut''' - 用于定义按钮的快捷方式。
+ * '''clicksound''' - 用于定义点击按钮时播放的声音。
+ * '''hint_tag''' - 用于设置指针悬停按钮时显示提示内容的提示键。
+ * '''pdx_tooltip''' - 用于设置使用按钮时的简短信息提示。
+ * '''pdx_tooltip_delayed''' - 用于设置使用按钮时的完整信息提示。
+ * '''scale''' - 用于定义缩放按钮大小。
+ 下列属性是几乎从未使用过的:
+ * '''tooltip''' - 请注意!这一条从未被使用过!
+ * '''tooltipText''' - 请注意!这一条从未被使用过!
+ * '''delayedTooltipText''' - 请注意!这一条从未被使用过!
+
== smoothListboxType ==
- The ''smoothListboxType'' element is used to define a listbox, which is a scrollable list that is populated with entries. Typically these elements are internally linked with another container, which composes the actual entry used in the list box.
+ '''smoothListboxType'''中的'''elements'''用于向界面增加'''平滑列表框'''贴图,这指的是包括诸多具体条目的可滚动平滑列表框。
- The following attributes are used:
- * '''name''' - The listbox name.
- * '''position''' - The screen position of the listbox.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
- * '''size''' - The bounding box for the listbox.
- * '''spacing''' - The spacing to use between listbox entries.
- * '''horizontal'' - Whether the listbox is horizontal (1) or vertical (0).
- * '''scrollbartype''' - The scrollbar to use for the listbox.
- * '''bordersize''' - The bounding box for the border for the listbox.
- * '''alwaystransparent''' - Forces the listbox to allow click through, i.e. clicking on an element behind another element.
+ 一般来说,这些'''elements'''与其他'''container'''中的'''internal'''代码相关联,该'''container'''主要用来定义平滑列表框中使用的具体文本。
- The following attributes are rarely or never used:
- * '''background''' - Never used.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义平滑列表框的命名。
+ * '''position''' - 用于定义平滑列表框的屏幕放置位置。
+ * '''orientation''' - 用于定义'''position'''属性的坐标原点。
+ * '''size''' - 用于定义平滑列表框的尺寸大小。
+ * '''spacing''' - 用于定义平滑列表框各条目之间的间距。
+ * '''horizontal''' - 用于定义平滑列表框是水平还是垂直的,1为水平,0为垂直。
+ * '''scrollbartype''' - 用于定义平滑列表框的滚动条。
+ * '''bordersize''' - 用于定义平滑列表框的边框范围。
+ * '''alwaystransparent''' - 用于定义平滑列表框是否允许点击,即点击'''elements'''后可以再点击'''elements'''。
+ 下列属性是几乎从未使用过的:
+ * '''background''' - 用于定义平滑列表框的背景,请注意!这一条从未被使用过!
+
== listboxType ==
- The ''listboxType '' element is used to define a listbox, which is a scrollable list that is populated with entries. Typically these elements are internally linked with another container, which composes the actual entry used in the list box.
+ '''listboxType'''中的'''elements'''用于向界面增加'''列表'''贴图,这指的是包括诸多具体条目的可滚动列表框。
- The following attributes are used:
- * '''name''' - The listbox name.
- * '''position''' - The screen position of the listbox.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
- * '''size''' - The bounding box for the listbox.
- * '''spacing''' - The spacing to use between listbox entries.
- * '''horizontal'' - Whether the listbox is horizontal (1) or vertical (0).
- * '''scrollbartype''' - The scrollbar to use for the listbox.
- * '''bordersize''' - The bounding box for the border for the listbox.
- * '''alwaystransparent''' - Forces the listbox to allow click through, i.e. clicking on an element behind another element.
+ 一般来说,这些'''elements'''与其他'''container'''中的'''internal'''代码相关联,该'''container'''主要用来定义列表框中使用的具体文本。
- The following attributes are rarely or never used:
- * '''background''' - Never used.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义列表框的命名。
+ * '''position''' - 用于定义列表框的屏幕放置位置。
+ * '''orientation''' - 用于定义'''position'''属性的坐标原点。
+ * '''size''' - 用于定义列表框的尺寸大小。
+ * '''spacing''' - 用于定义列表框各条目之间的间距。
+ * '''horizontal''' - 用于定义列表框是水平还是垂直的,1为水平,0为垂直。
+ * '''scrollbartype''' - 用于定义列表框的滚动条。
+ * '''bordersize''' - 用于定义列表框的边框范围。
+ * '''alwaystransparent''' - 用于定义列表框是否允许点击,即点击'''elements'''后可以再点击'''elements'''。
+ 下列属性是几乎从未使用过的:
+ * '''background''' - 用于定义平滑列表框的背景,请注意!这一条从未被使用过!
+
== checkboxType ==
- The ''checkboxType '' element is used to add checkboxes to the interface. The actual effect of the checkbox is defined internally.
+ '''checkboxType'''中的'''elements'''用于向界面增加'''复选框'''贴图,复选框的'''elements'''都与'''internal'''代码相关联
- The following attributes are used:
- * '''name''' - The checkbox name.
- * '''position''' - The screen position of the checkbox.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
- * '''spriteType''' - The image to use for the checkbox. Refers to a ''spriteType'' definition.
- * '''quadTextureSprite''' - The image to use for the checkbox. Refers to a dynamic ''spriteType'' definitions (i.e. flags) or multi-frame ''spriteType'' definitions.
- * '''frame''' - Which frame to use for the checkbox when using a multi-frame image.
- * '''alwaystransparent''' - Forces the checkbox to allow click through, i.e. clicking on an element behind another element.
- * '''buttonText''' - The text displayed by the checkbox.
- * '''buttonFont''' - The font to display the checkbox text in.
- * '''shortcut''' - The shortcut to add for this checkbox.
- * '''clicksound''' - The sound to use when clicked.
- * '''hint_tag''' - Set the hint key the checkbox uses to display a hint tooltip with when hovered over.
- * '''pdx_tooltip''' - Set the short tooltip this checkbox uses.
- * '''pdx_tooltip_delayed''' - Set the full tooltip this checkbox uses.
- * '''scale''' - Scales the checkbox size.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义复选框的命名。
+ * '''position''' - 用于定义复选框的屏幕放置位置。
+ * '''orientation''' - 用于定义'''position'''属性的坐标原点。
+ * '''spriteType''' - 用于定义复选框贴图,这指向的是'''spriteType'''中定义的内容。
+ * '''quadTextureSprite''' - 用于定义复选框贴图。这指向的是动态'''spriteType'''中定义的内容(即'''标志''')或者多帧'''spriteType'''中定义的内容。
+ * '''frame''' - 用于定义使用多帧贴图时,复选框应当使用第几帧贴图。
+ * '''alwaystransparent''' - 用于定义复选框是否允许点击,即点击'''elements'''后可以再点击'''elements'''。
+ * '''buttonText''' - 用于定义复选框显示的文本内容。
+ * '''buttonFont''' - 用于定义复选框显示的字体内容。
+ * '''shortcut''' - 用于定义复选框的快捷方式。
+ * '''clicksound''' - 用于定义点击复选框时播放的声音。
+ * '''hint_tag''' - 用于设置指针悬停复选框时显示提示内容的提示键。
+ * '''pdx_tooltip''' - 用于设置使用复选框时的简短信息提示。
+ * '''pdx_tooltip_delayed''' - 用于设置使用复选框时的完整信息提示。
+ * '''scale''' - 用于定义复选框大小。
- The following attributes are rarely or never used:
- * '''tooltip''' - Never used.
- * '''tooltipText''' - Never used.
- * '''delayedTooltipText''' - Never used.
+ 下列属性是几乎从未使用过的:
+ * '''tooltip''' - 请注意!这一条从未被使用过!
+ * '''tooltipText''' - 请注意!这一条从未被使用过!
+ * '''delayedTooltipText''' - 请注意!这一条从未被使用过!
== editBoxType ==
- The ''editBoxType'' element is used to add editable textboxes to the interface.
+ '''editBoxType'''中的'''elements'''用于向界面添加'''可编辑文本框'''贴图。
- The following attributes are used:
- * '''name''' - The textbox name.
- * '''position''' - The screen position of the textbox.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
- * '''text''' - The text displayed by the textbox.
- * '''font''' - The font to use for the text.
- * '''maxWidth''' - The total width in pixels at which text is displayed.
- * '''maxHeight''' - The total height in pixels at which text is displayed.
- * '''format''' - How the text is aligned.
- * '''fixedsize''' - Whether the textbox should truncate text that exceeds its limits.
- * '''borderSize''' - The bounding box for the border of the textbox.
- * '''alwaystransparent''' - Forces the text to allow click through, i.e. clicking on an element behind another element.
- * '''ignore_tab_navigation''' - Makes the element ignore tab navigation.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义可编辑文本框的命名。
+ * '''position''' - 用于定义可编辑文本的屏幕放置位置。
+ * '''orientation''' - 用于定义'''position'''属性的坐标原点。
+ * '''text''' - 用于定义可编辑文本框显示的文本内容。
+ * '''font''' - 用于定义可编辑文本框显示的字体内容。
+ * '''maxWidth''' - 用于定义可编辑文本框的总宽度,这里是以像素为单位的。
+ * '''maxHeight''' - 用于定义可编辑文本框的总高度,这里是以像素为单位的。
+ * '''format''' - 用于定义可编辑文本框的对齐方式
+ * '''fixedsize''' - 用于定义可编辑文本框是否将超出其限制范围的文本内容删除。
+ * '''borderSize''' - 用于定义可编辑文本框的边框范围。
+ * '''alwaystransparent''' - 用于定义文本框是否允许点击,即点击'''elements'''后可以再点击'''elements'''。
+ * '''ignore_tab_navigation''' - 用于定义'''elements'''是否可以忽略可编辑文本框的导航标签
== OverlappingElementsBoxType ==
- The ''OverlappingElementsBoxType'' element is used to define a special kind of listbox that dynamically overlaps sub-elements within itself.
+ '''OverlappingElementsBoxType'''中的'''elements'''用于向界面增加一种特殊类型的列表框。
- The following attributes are used:
- * '''name''' - The listbox name.
- * '''position''' - The screen position of the listbox.
- * '''orientation''' - Sets the orientation origin for the ''position'' attribute.
- * '''size''' - The bounding box for the listbox.
- * '''spacing''' - The spacing to use between listbox entries.
- * '''horizontal'' - Whether the listbox is horizontal (1) or vertical (0).
- * '''bordersize''' - The bounding box for the border for the listbox.
- * '''alwaystransparent''' - Forces the listbox to allow click through, i.e. clicking on an element behind another element.
+ 该列表框在其'''container'''中包含可重叠的子'''elements'''内容。
- The following attributes are rarely or never used:
- * '''textureFile''' - Never used for anything.
+ 下列属性是经常使用的:
+ * '''name''' - 用于定义列表框的命名。
+ * '''position''' - 用于定义列表框的屏幕放置位置。
+ * '''orientation''' - 用于定义'''position'''属性的坐标原点。
+ * '''size''' - 用于定义列表框的尺寸大小。
+ * '''spacing''' - 用于定义列表框各条目之间的间距。
+ * '''horizontal'' - 用于定义列表框是水平还是垂直的,1为水平,0为垂直。
+ * '''bordersize''' - 用于定义列表框的边框范围。
+ * '''alwaystransparent''' - 用于定义列表框是否允许点击,即点击'''elements'''后可以再点击'''elements'''。
- Valid ''format'' values:
+ 下列属性是几乎从未使用过的:
+ * '''textureFile''' - 请注意!这一条从未被使用过!
+
+ 有效的 ''format'' 值:
* left
* centre
* right
== Position and Orientation ==
- Understanding how the position coordinates work is important to understanding how to edit interfaces correctly.
+ 理解'''position'''属性是如何运作的对于准确的编辑'''界面'''而言是非常重要的。
- The ''orientation'' attribute used by an element (or container) informs you where the anchor point for the element is. For example, ''UPPER_LEFT'' means the ''( 0, 0 )'' position is in the top left corner of the screen, whereas ''LOWER_RIGHT'' is the bottom right.
+ '''elements'''(或'''container''')使用的'''orientation'''属性是用来定义'''position'''坐标原点的。
- The ''position'' attribute then works from this origin position. Therefore if you want an element to be on the opposite side of the screen, you'd want to change the ''orientation'' first.
+ 例如'''UPPER_LEFT'''表示'''position'''(0,0)这一坐标原点位于屏幕的左上角,而 '''LOWER_RIGHT'''表示'''position'''(0,0)这一坐标原点位于屏幕的右下角。
- This is system is used because it allows the interface to adapt to different resolutions. Because all positions are tied to a specific origin that is dynamically calculated from the player's screen resolution, the placement of containers and elements are kept consistent.
+ '''position''' 属性将在'''orientation'''属性定义坐标原点之后生效。因此,如果您希望'''elements'''(或'''container''')更改初始位置,您应该首先更改'''orientation'''属性再更改'''position''' 属性。
- So, if you want to ensure your interface edits are consistent, you must use the ''orientation'' attribute properly.
+ 之所以这样设置'''position'''属性和'''orientation'''属性是因为这样可以允许界面适应不同的分辨率。
- An mistake would be to edit the ''position'' solely, for example <code>position = { x = 1800 y = 200 }</code>. This would look fine for anybody with a screen width greater than 1800px (i.e. 1900 x 1200 upwards), but the element would be off screen for those with smaller screens.
+ 因为所有的'''position'''都与一个特定的'''orientation'''相关联,该'''position'''是根据玩家的屏幕分辨率而计算的,所以'''elements'''和'''container'''的位置应当保持一致。
- Valid ''orientation'' values:
+ 因此,如果要确保编辑界面后整个界面可以正常运作就必须正确的使用'''orientation'''属性。
+
+ 举一个典型的错误类型,如果仅仅编辑'''position'''属性,例如<code>position = { x = 1800 y = 200 }</code>这一'''position'''属性意味着对于设置分辨率宽度大于1800像素的分辨率(如1900 x 1200像素)的玩家来说将可以正常显示,而分辨率的宽度低于1800像素的玩家则无法正常显示。
+
+ 有效的 ''orientation'' 值:
* CENTER
* UPPER_LEFT
* LOWER_LEFT
* UPPER_RIGHT
* LOWER_RIGHT
== Resolution Checks ==
- By using the ''if_resolution'' scope within containers and elements, you can change how they are displayed depending on the screen width and height.
+ 通过在'''container'''和'''elements'''中使用'''if_resolution'''语句来进行定义,您就可以根据屏幕宽度和高度的不同来更改它们的显示方式。
- This is useful when ''orientation'' cannot achieve, i.e. moving a button because the background used is changed depending on resolution.
+ 当'''orientation'''属性无法生效时,比如无法移动界面时,通过定义'''if_resolution'''是相当有用的,因为使得界面可以根据分辨率不同而改变。
- Here is an example of moving a button:
+ 以下是移动按钮界面的示例:
<pre>
guiButtonType = {
- name =\"close_button\"
+ name ="close_button"
if_resolution = {
max_height = 867
position = { x = 560 y = -48 }
- quadTextureSprite = \"GFX_button_close\"
- buttonText = \"\"
+ quadTextureSprite = "GFX_button_close"
+ buttonText = ""
}
if_resolution = {
min_height = 868
- quadTextureSprite =\"button_type_1\"
+ quadTextureSprite ="button_type_1"
position = { x= 214 y = 664 }
- buttonText = \"CLOSE\"
+ buttonText = "CLOSE"
}
- buttonFont = \"vic_18\"
- shortcut = \"ESCAPE\"
+ buttonFont = "vic_18"
+ shortcut = "ESCAPE"
}
</pre>
- Here is an example of changing the background image:
+ 以下是更改背景贴图的示例:
<pre>
iconType =
{
- name =\"religionpanel_bg_bottom\"
+ name ="religionpanel_bg_bottom"
if_resolution = {
max_height = 899
- spriteType = \"GFX_country_religion_view_bg_bottom_standard\"
+ spriteType = "GFX_country_religion_view_bg_bottom_standard"
}
if_resolution = {
max_height = 1079
min_height = 900
- spriteType = \"GFX_country_religion_view_bg_bottom_large\"
+ spriteType = "GFX_country_religion_view_bg_bottom_large"
}
if_resolution = {
min_height = 1080
- spriteType = \"GFX_country_religion_view_bg_bottom_huge\"
+ spriteType = "GFX_country_religion_view_bg_bottom_huge"
}
position = { x= -7 y = -10 }
- Orientation = \"UPPER_LEFT\"
+ Orientation = "UPPER_LEFT"
}
</pre>
+ == 参考资料 ==
+ <references/>
+
{{Modding navbox}}
- [[Category:改派教程]]
+ [[Category:模组制作]]
+ [[en:Interface modding]]
