Graphical asset模组制作
原页面:Graphical asset modding
图形素材是在.gfx文件中定义过的图像文件。这会把图像绑定到一个脚本名称,之后在.gui界面文件中引用该名称。
图形素材文件可在/Hearts of Iron IV/interface/*.gfx中找到。
请注意,对于许多素材(例如科技与装备素材定义),图像可以为特定 tag 指定,即GFX_ENG_<name>,它只为指定的 tag 显示该素材。这会覆盖同名的基准素材。这也适用于图形文化,即GFX_african_<name>。
spriteType
spriteType与textSpriteType素材条目遵循以下格式:
spriteTypes = {
spriteType = {
name = "GFX_<name>"
texturefile = <path>
noOfFrames = <int>
effectFile = <path>
allwaystransparent = <bool>
legacy_lazy_load = <bool>
transparencecheck = <bool>
animation = {
animationmaskfile = <path>
animationtexturefile = <path>
animationrotation = <float>
animationlooping = <bool>
animationtime = <float>
animationdelay = <float>
animationblendmode = <mode>
animationtype = <type>
animationrotationoffset = {
x = <float>
y = <float>
}
animationtexturescale = {
x = <float>
y = <float>
}
animationframes = {
<int> <int> # etc
}
}
}
}
name是你为该素材指定的名称。它可能带有各种其他前缀段,例如用于理念图像的idea等。
texturefile是图像的路径,基于/Hearts of Iron IV/,意味着你只需包含此文件夹内的各层文件夹,而不是完整文件路径。
noOfFrames用于内部含多个frames的图像,例如GFX_unit_level内部有五个图像分别对应各个单位等级图像,因此会在其素材定义中设置noOfFrames = 5。
effectFile用于定义应用于图像的效果状态,即按钮图像上的按下效果。效果可在/Hearts of Iron IV/gfx/FX/*.lua中找到。可以定义多个以添加多个效果。
allwaystransparent定义图像是否可以被点击与交互。如果是,该图像在游戏中使用时将没有提示框且无法被点击。
legacy_lazy_load定义图像是否延迟加载。
transparencecheck定义图像在玩家点击方面是否受其 alpha 通道约束。否则,边界框就是图像尺寸。
animation作用域用于为图像添加动画。它使用以下属性:
- animationmaskfile控制动画的遮罩图像。
- animationtexturefile控制用于动画的颜色图像。
- animationrotation控制动画图像的旋转。默认情况下为顺时针 -90。
- animationlooping控制动画是否循环。
- animationtime控制动画的持续时间。以秒为单位。
- animationdelay控制动画循环之间的延迟。以秒为单位。
- animationblendmode控制动画图像的混合模式。可以是add、multiply或overlay。
- animationtype控制动画的类型。可以是scrolling、rotating或pulsing。
- animationrotationoffset控制旋转的x与y偏移。
- animationtexturescale控制动画图像的缩放。
- animationframes设置动画图像内的帧数。
请注意,sprite .dds 文件的最大文件大小约为 16MB
frameAnimatedSpriteType
frameAnimatedSpriteType素材条目遵循以下格式:
spriteTypes = {
frameAnimatedSpriteType = {
name = "GFX_<name>"
texturefile = "<path>"
noOfFrames = <int>
effectFile = "<path>"
animation_rate_fps = <int>
looping = <bool>
play_on_show = <bool>
pause_on_loop = <float>
allwaystransparent = <bool>
}
}
name是你为该素材指定的名称。它可能带有各种其他前缀段,例如用于理念图像的idea等。
texturefile是图像的路径,基于/Hearts of Iron IV/,意味着你只需包含此文件夹内的各层文件夹,而不是完整文件路径。
noOfFrames用于内部含多个frames的图像,例如GFX_unit_level内部有五个图像分别对应各个单位等级图像,因此会在其素材定义中设置noOfFrames = 5。
effectFile用于定义应用于图像的效果状态,即按钮图像上的按下效果。效果可在/Hearts of Iron IV/gfx/FX/*.lua中找到。可以定义多个以添加多个效果。
animation_rate_fps是动画播放的速率。
looping定义动画是否循环。
play_on_show定义动画是否在可见时开始播放。
pause_on_loop定义动画循环后暂停的时间长度。
allwaystransparent定义图像在玩家点击方面是否受其 alpha 通道约束。否则,边界框就是图像尺寸。
progressbartype
progressbartype素材条目用于进度条。它遵循以下格式:
spriteTypes = {
progressbartype = {
name = "GFX_<name>"
textureFile1 = "<path>"
textureFile2 = "<path>"
color = { <r> <g> <b> [<a>] }
colortwo = { <r> <g> <b> [<a>] }
size = {
x = <int>
y = <int>
}
effectFile = <path>
horizontal = <bool>
steps = <int>
}
}
name是你为该素材指定的名称。它可能带有各种其他前缀段,例如用于理念图像的idea等。textureFile1是用于进度条的图像。textureFile2是用于进度条背景的图像。color定义条形的未完成颜色。它是十进制 RGBA。Alpha 可选。colortwo定义条形的已完成颜色。它是十进制 RGBA。Alpha 可选。规模定义进度条部分的高度与宽度尺寸。effectFile用于定义应用于图像的效果状态,即按钮图像上的按下效果。效果可在/Hearts of Iron IV/gfx/FX/*.lua中找到。可以定义多个以添加多个效果。horizontal定义进度条是否为水平。默认情况下条形是水平的。steps定义进度条的精度,即它被分成多少帧。未设置时默认为 100。
corneredTileSpriteType
A corneredTileSpriteType asset entry is used for tiling textures that tile to fill the size of the interface element they are used in. It follows this format:
spriteTypes = {
corneredTileSpriteType = {
name = "GFX_<name>"
texturefile = "<path>"
noOfFrames = <int>
size = {
x = <int>
y = <int>
}
borderSize = {
x = <int>
y = <int>
}
effectFile = <path>
allwaystransparent = <bool>
tilingCenter = <bool>
looping = <bool>
animation_rate_spf = <int>
}
}
name是你为该素材指定的名称。它可能带有各种其他前缀段,例如用于理念图像的idea等。
texturefile是图像的路径,基于/Hearts of Iron IV/,意味着你只需包含此文件夹内的各层文件夹,而不是完整文件路径。
noOfFrames用于内部含多个frames的图像,例如GFX_unit_level内部有五个图像分别对应各个单位等级图像,因此会在其素材定义中设置noOfFrames = 5。
规模确定平铺单元的尺寸。
borderSize确定边框的尺寸。
effectFile用于定义应用于图像的效果状态,即按钮图像上的按下效果。效果可在/Hearts of Iron IV/gfx/FX/*.lua中找到。可以定义多个以添加多个效果。
allwaystransparent定义图像在玩家点击方面是否受其 alpha 通道约束。否则,边界框就是图像尺寸。
tilingCenter定义图像平铺时是使用图像中心还是左上角。
looping定义动画是否循环。
animation_rate_spf定义动画播放的帧率。
maskedShieldType
maskedShieldType素材条目用于国家盾徽。它遵循以下格式:
spriteTypes = {
corneredTileSpriteType = {
name = "GFX_<name>"
textureFile1 = <path>
textureFile2 = <path>
effectFile = <path>
}
}
name是你为该素材指定的名称。它可能带有各种其他前缀段,例如用于理念图像的idea等。
textureFile1是用于盾徽背景的图像
textureFile2是用于盾徽遮罩的图像。
effectFile用于定义应用于图像的效果状态,即按钮图像上的按下效果。效果可在/Hearts of Iron IV/gfx/FX/*.lua中找到。可以定义多个以添加多个效果。
animatedmaptext
A animatedmaptext asset entry is used for text that appears from the map. It follows this format:
objectTypes = {
animatedmaptext = {
name = <name>
speed = <float>
textblock = {
text = <string>
color = { <r> <g> <b> }
font = <path>
position = {
x = <int>
y = <int>
}
size = {
x = <int>
y = <int>
}
format = <type>
cull_distance = <float>f
}
}
}
name is the name of the map text. It is not possible to add custom ones.
速度 is the fade time of the text.
textblock controls the attributes of the text that appears.
textcolors
A textcolors entry defines the text colors used in localization with the § symbol. It follows this format:
bitmapfonts = {
textcolors = {
<symbol> = { <r> <g> <b> }
}
}
symbol是本地化中使用的字符,即H。
RGB是该符号应用的颜色。它是整数 RGB。
bitmapfont
bitmapfont条目定义游戏中使用的字体。它遵循以下格式:
bitmapfonts = {
bitmapfont = {
name = <name>
path = <path>
color = <hex>
border_color = <hex>
fontfiles = {
<path>
<path>
}
textcolors = {
<symbol> = { <r> <g> <b> }
}
cursor_offset = {
<int>
<int>
}
}
}
name是供其他图形文件引用的字体名称。
path是字体的路径。字体可在/Hearts of Iron IV/gfx/fonts/中找到。
color是字体的默认颜色。它是十六进制 RGB 代码。
border_color是字体的边框颜色。它是十六进制 RGB 代码。
fontfiles用于一个字体有多个字体图像的情况,即支持英语与西里尔字母。它用于替代path。
textcolors alters the global textcolors for the font it is nested within.
cursor_offset offsets the text cursor for the font. Defines the x position and then the y position.
bitmapfont_override
bitmapfont_override条目用于为特定语言区域覆盖字体。它遵循以下格式:
bitmapfonts = {
bitmapfont_override = {
name = <name>
fontfiles = {
<path>
<path>
}
languages = {
<language>
<language>
}
}
}
name是要覆盖的字体名称。
fontfiles用于一个字体有多个字体图像的情况,即支持英语与西里尔字母。它用于替代path。
languages定义此覆盖适用于哪些语言。
| 文档 | 效果 • 触发器 • 定义文件 • 修正项 • 修正项列表 • 作用域 • 本地化文件 • 事件钩子 • 数据结构(标记、事件目标、国家标签别名、变量、数组) |
| 脚本 | 成就 • AI • AI 焦点 • 自治领 • 力量均势 • 书签/剧本 (游戏规则) • 建筑 • 角色与特质 • 外观标签 • 国家 • 师 • 决议 • 学说 • 装备 • 事件 • 阵营 • 理念 • 意识形态 • 军事工业组织 • 国策 • 资源 • 脚本化 GUI • 科技与学说 • 单位 |
| 地图 | 地图 • 州 • 补给区域 • 战略区域 |
| 图形 | 界面 • 图形资源 • 实体 • 后期特效 • 粒子 • 字体 |
| 外观 | 肖像 • 名称列表 • 音乐 • 音效 |
| 其他 | 控制台指令 • 疑难排查 • 模组结构 • 模组 • 地图编辑器 |