Icon modding

本頁面部分全部內容上次核對於2.0版本


The interface icons are defined in interface/icons.gfx, and the image files are found in gfx/interface. Some icon types need to be defined as sprites prior to being used in the game. When that requirement exists, it is common to define a sprite in a .gfx file in <yourmod>/interface/<filename>.gfx. Sprites in the mod file look like this:

 spriteType = {
     name = "GFX_message_diplomatic_war"
     texturefile = "gfx/interface/icons/message/message_diplomatic_war.dds"
 }

 spriteType = {
     name = "GFX_component_weapon_slot_size_icons"
     texturefile = "gfx/interface/ship_designer/component_slot_size_weapon_icons.dds"
     noOfFrames = 5
 }

Note how the sprite file itself makes use of DDS format icons, using that A8R8G8B8 setting. The icons are found in Stellaris/gfx/interface/icons and its subfolders. Some game elements do not require the sprite type to be created first. Instead, the game automatically generates the sprite, and looks for a DDS format file matching the component in the relevant subdirectory. An icon = command is therefore not required. These include:

Entity .DDS file location
buildings gfx/interface/icons/buildings
technologies gfx/interface/icons/technology
civics gfx/interface/icons/governments/civics
authorities gfx/interface/icons/governments/authorities
governments gfx/interface/icons/governments
ethics gfx/interface/icons/ethics
ascension_perks gfx/interface/icons/ascension_perks
tile_backgrounds gfx/interface/icons/tile_backgrounds
tile_blockers gfx/interface/icons/tile_blockers
environments gfx/portraits/environments

Note that while for the above items, the icon = is not required, it is often optionally allowed. For example, one might include a line in the entity description that says: icon = GFX_message_diplomatic_war. When this is supported by the game, it looks for a sprite definition (from a .gfx file) with the matching name. This feature is convenient for modders who ant to reuse an existing art file without copying it (thereby saving space in the mod).

Tile Blockers are a special case. These are of the format <tileblocker>_<number>, where 'tileblocker' is the key in the tileblocker file and 'number' is an integer valued from 1 to N. So, for example, for the vanilla tile blocker for mountain ranges, with a key of 'tb_mountain_range', the game will look for tb_mountain_range_1.dds, tb_mountain_range_2.dds, and so forth, and cycle between them, in order to visually differentiate the interface.

Tile Backgrounds (which represent the colonized planet background image) follow a similar pattern to Tile Blockers (the numbers add flavor and variation to the displayed colonies).

The Planetary Modifiers are recognisable by their presence in the interface in planet view. The coloured ring around the modifier is determined by the line iconFrame = 1 within the text file where the planetary modifier is defined. The number determines whether a green, orange or red circle is displayed. Any input number above 5 will lead to a planetary modifier that does have a coloured ring.

Environments graphics are keyed by <planetclass>_ with two different extension types: 'sky' and 'l0'<1..N>. That's an 'Ell' and not a 'One'. So a valid environment set of files might be gaia_sky.dds, gaia_l01.dds, gaia_l02.dds, and so on.


References[編輯 | 編輯原始碼]


帝國 帝國思潮政府 • 國民理念 • 起源承諾議程傳統 • 飛升天賦法令政策遺珍科技自定義帝國
人口 崗位派系
領袖 領袖領袖特質
物種 物種物種特質
行星 行星行星特徵 • 軌道礦藏建築 • 區劃行星決議
星系 星系恆星基地巨型結構蟲洞 • 星門地圖
艦隊 艦隊艦船 • 部件
地面戰 陸軍轟炸姿態
外交 外交 • 聯邦 • 星海共同體評價修正宣戰理由 • 戰爭目標
事件 事件異常現象特殊項目考古遺址
遊玩 遊玩定義研究 • 經濟遊戲開局
動態修改 動態指令效果觸發條件作用域修正變量AI
媒體/本地化 Maya 導出器圖形肖像旗幟事件圖片界面圖標音樂本地化
Other 控制台命令存檔編輯Steam 創意工坊模組製作教程