Difference between revisions of "User:Xyloz/sandbox"

From Europa Universalis 4 Wiki
Jump to navigation Jump to search
(Remove test page from categories.)
 
Line 1: Line 1:
{{version|1.23}}
+
<nowiki>{{version|1.23}}</nowiki>
 
In Europa Universalis IV, the interface is the collection of graphical elements that make up the user interface. All files relating to the interface can be found in {{path|interface/}}.
 
In Europa Universalis IV, the interface is the collection of graphical elements that make up the user interface. All files relating to the interface can be found in {{path|interface/}}.
  
Line 467: Line 467:
 
|}
 
|}
  
{{Modding navbox}}
+
<nowiki>{{Modding navbox}}
[[Category:Modding]]
+
[[Category:Modding]]</nowiki>

Latest revision as of 10:14, 16 February 2018

{{version|1.23}} In Europa Universalis IV, the interface is the collection of graphical elements that make up the user interface. All files relating to the interface can be found in /Europa Universalis IV/interface/.

Overview

All assets in Europa Universalis IV require an entry within a gfx file. If you wanted to add a new background, you'd first need to create an gfx entry for the image, the name of which is then referred to in gui files.

To safely add new entries, you should create a gfx file for your mod, naming it similar to this: z_mymod.gfx. The gfx filesystem loads the entries in alphabetical order, meaning if you want to override an vanilla entry (i.e. GFX_icon_religion), you can just add an entry into your mod's gfx file, and it will override the vanilla entry.

The gfx file itself follows this structure:

spriteTypes = {
    spriteType = {
        # ...
    }
}

Each entry is a spriteType, which are nested within the spriteTypes scope.

A basic spriteType entry itself follows this structure:

spriteType = {
    name = "<name here"
    textureFile = "<path here>"
}

GUI Types

Type here refer to the interface definitions in gui files. There are multiple kinds of types, each with a specific usage. Types each have different sets of attributes depending on their usage.

Whilst most attributes are self-evident, the following reference details each attribute a type can have and what each attribute is used for. Not all attributes are required when using an type.

windowType

Used to define windows.

Type Description Example
name The script name used for the window. name = "nudge_window_trade_route"
background Assigns an element as the background for the window. Generally used when the background is a guiButtonType and movable. backGround="Background"
position The initial position of the window. Affected by the orientation attribute. position = { x=-400 y=-290 }
show_position The show position of the window if animated. Affected by the orientation attribute. show_position = { x=0 y =140 }
hide_position The hide position of the window if animated. Affected by the orientation attribute.
Typically off-screen so the window disappears.
hide_position = { x=-600 y =140 }
animation_type The animation type of the window if animated. animation_type = "decelerated"
animation_time The animation time of the window if animated. animation_time = 300
size The bounding box size for the window. size = { x = 350 y = 240 }
orientation The origin point for the coordinates used in the position attribute. Orientation = "LOWER_RIGHT"
moveable Whether this window can be moved by the player. moveable = 1
fullscreen Whether this window is considered fullscreen. Being fullscreen prevents interaction with other interfaces whilst active. fullscreen = 1
upsound The sound to play when the window appears.
Sounds are found in /Europa Universalis IV/sound/*.asset
upsound = tab_court
dontRender Unused. dontRender = ""
horizontalBorder Unused. horizontalBorder= ""
verticalBorder Unused. verticalBorder= ""
downsound Unused. downsound = ""

GFX Types

Type here refer to the asset definitions in gfx files. There are multiple kinds of types, each with a specific usage. Typeseach have different sets of attributes depending on their usage.

Whilst most attributes are self-evident, the following reference details each attribute a type can have and what each attribute is used for. Not all attributes are required when using an type.

spriteType

Used for general images.

Type Description Example
name The script name for the asset. name = "GFX_ticking_war_score"
texturefile The image the asset ues.
The texture file path is relative to the mod directory the gfx file is located in.
texturefile = "gfx//interface//ticking_war_score.tga"
noOfFrames If an asset is an image strip, this defines the number of frames to split the image into. noOfFrames = 5
overlay_frames_per_row If an asset is an image strip with multiple rows, this tells the game how many frames to split per row. overlay_frames_per_row = 32
overlay_rows If an asset is an image strip with multiple rows, this tells the game how many rows there are. overlay_rows = 4
loadType How the asset is loaded. Only added if the INGAME or FRONTEND type is needed. loadType = "INGAME"
transparencecheck Whether to shape the bounding box of an asset to it's alpha mask. transparencecheck = yes
allwaystransparent Whether to always treat this asset as transparent. allwaystransparent = yes
effectFile Whether an effect file should be applied to this asset. Typically used for button icons so they change correctly. effectFile = "gfx/FX/buttonstate.lua"
clicksound The sound to play when the asset is clicked. clicksound = click
legacy_lazy_load Whether the asset should not use the legacy lazy load method. legacy_lazy_load = no
norefcount ? norefcount = yes

textSpriteType

Used for images that have text applied programmatically on top.

Type Description Example
name The script name for the asset. name = "GFX_ticking_war_score"
texturefile The image the asset ues.
The texture file path is relative to the mod directory the gfx file is located in.
texturefile = "gfx//interface//ticking_war_score.tga"
noOfFrames If an asset is an image strip, this defines the number of frames to split the image into. noOfFrames = 5
overlay_frames_per_row If an asset is an image strip with multiple rows, this tells the game how many frames to split per row. overlay_frames_per_row = 32
overlay_rows If an asset is an image strip with multiple rows, this tells the game how many rows there are. overlay_rows = 4
loadType How the asset is loaded. Only added if the INGAME or FRONTEND type is needed. loadType = "INGAME"
transparencecheck Whether to shape the bounding box of an asset to it's alpha mask. transparencecheck = yes
allwaystransparent Whether to always treat this asset as transparent. allwaystransparent = yes
effectFile Whether an effect file should be applied to this asset. Typically used for button icons so they change correctly. effectFile = "gfx/FX/buttonstate.lua"
clicksound The sound to play when the asset is clicked. clicksound = click

progressBarType

Used to define progress bar assets.

Type Description Example
name The script name for the asset. name = "GFX_war_goal_progressbar"
color The color alpha to apply when the bar is 'complete'. color = { 0.0 0.5 0.0 }
colortwo The color alpha to apply when the bar is 'progressing'. colortwo = { 1.0 0.0 0.0 }
texturefile1 The image the progress bar applies over the background image.

The texture file path is relative to the mod directory the gfx file is located in.

textureFile1 = "gfx\\interface\\unitpanel_progressbar_w10_h39_green.dds"
texturefile2 The image the progress bar uses as the background image.

The texture file path is relative to the mod directory the gfx file is located in.

textureFile2 = "gfx\\interface\\unitpanel_progressbar_w10_h39_red.dds"
size The height and width of the progress bar. size = { x = 300 y = 30 }
effectFile Whether an effect file should be applied to this asset. effectFile = "gfx/FX/progress.lua"

corneredTileSpriteType

Used to define tiling images.

Type Description Example
name The script name for the asset. name = "GFX_volume_track"
texturefile The image the asset uses.
The texture file path is relative to the mod directory the gfx file is located in.
texturefile = "gfx//interface//ticking_war_score.tga"
size The height and width of the image. size = { x = 12 y = 12 }
borderSize The height and width (from the edge) of the image to consider as the border size = { x = 4 y = 4 }

frameAnimatedSpriteType

Used to define animated images.

Type Description Example
name The script name for the asset. name = "GFX_ticking_war_score"
texturefile The image the asset uses.
The texture file path is relative to the mod directory the gfx file is located in.
texturefile = "gfx//interface//ticking_war_score.tga"
noOfFrames If an asset is an image strip, this defines the number of frames to split the image into. noOfFrames = 5
overlay_frames_per_row If an asset is an image strip with multiple rows, this tells the game how many frames to split per row. overlay_frames_per_row = 32
overlay_rows If an asset is an image strip with multiple rows, this tells the game how many rows there are. overlay_rows = 4
loadType How the asset is loaded. Only added if the INGAME or FRONTEND type is needed. loadType = "INGAME"
transparencecheck Whether to shape the bounding box of an asset to it's alpha mask. transparencecheck = yes
allwaystransparent Whether to always treat this asset as transparent. allwaystransparent = yes
animation_rate_fps The animation frame rate. animation_rate_fps = 20
looping Whether the animation loops or not. looping = yes
play_on_show Whether to start the animation as soon as the asset appears. play_on_show = yes
pause_on_loop The time in seconds to wait until repeating the animation if looping. pause_on_loop = 2.0

maskedShieldType

Used to define flag assets.

Type Description Example
name The script name for the asset. name = "thinshield"
textureFile1 The image used for the flag frame.

The texture file path is relative to the mod directory the gfx file is located in.

textureFile1 = "gfx//interface//shield_frame.tga"
textureFile2 The image used for the flag mask.

The texture file path is relative to the mod directory the gfx file is located in.

textureFile2 = "gfx//interface//shield_mask.tga"
textureFile3 The image used for the flag.

The texture file path is relative to the mod directory the gfx file is located in.

textureFile3 = "gfx//interface//client_state_symbols_medium.dds"
effectFile Whether an effect file should be applied to this asset. effectFile = "gfx/FX/maskedflag.lua"
noOfFrames If an asset is an image strip, this defines the number of frames to split the image into. noOfFrames = 5
overlay_frames_per_row If an asset is an image strip with multiple rows, this tells the game how many frames to split per row. overlay_frames_per_row = 32
overlay_rows If an asset is an image strip with multiple rows, this tells the game how many rows there are. overlay_rows = 4

PieChartType

Used to define pie chart assets.

Type Description Example
name The script name for the asset. name = "GFX_trade_power_chart"
size The radius of the pie chart that is generated.
size = 35

LineChartType

Used to define line chart assets.

Type Description Example
name The script name for the asset. name = "GFX_ledger_line_default"
size The height and width of the line chart.
size = { x=690 y=485 }
linewidth The line width of the line chart. linewidth = 2

tradeRouteType

Used to define the traderoute arrow.

Type Description Example
name The script name for the asset. name = "traderoute"
texturefile1 The color image to use.

The texture file path is relative to the mod directory the gfx file is located in.

textureFile = "gfx//mapitems//trade_route_arrow.dds"
texturefile2 The normal image to use.

The texture file path is relative to the mod directory the gfx file is located in.

textureFile2 = "gfx//mapitems//trade_route_arrow_normal.dds"
texturefile3 The color image to use when in a 'terrain' mapmode.

The texture file path is relative to the mod directory the gfx file is located in.

textureFile3 = "gfx//mapitems//trade_route_arrow_terrain.dds"
cull_distance The height value (of the camera) at which the asset should be culled. cull_distance = 10000
effect Whether an effect file should be applied to this asset. effect = "gfx/FX/traderoute.lua"

Constants

Some attributes in both gfx and gui files take constants, such as orientation. These are lists of the accepted values for each attribute.

Attribute Accepted Values
loadType
  • INGAME
  • FRONTEND
orientation
  • CENTER
  • UPPER_LEFT
  • LOWER_LEFT
  • UPPER_RIGHT
  • LOWER_RIGHT
animation_type
  • decelerated

{{Modding navbox}} [[Category:Modding]]