20,741
edits
Line 993: | Line 993: | ||
== Styling == | == Styling == | ||
{{WIP}} | {{WIP}} | ||
For a list of MapStructure files (meanwhile incomplete), see: [[Canvas MapStructure Layers]] | For a list of MapStructure files (meanwhile incomplete), see: [[Canvas MapStructure Layers]] | ||
Once you have found a layer that is not yet style-able, you need to encode style-able attributes using the relevant_keys vector.<ref>{{cite web | Once you have found a layer that is not yet style-able, you need to encode style-able attributes using the relevant_keys vector.<ref>{{cite web | ||
Line 1,004: | Line 1,002: | ||
|script_version = 0.40 | |script_version = 0.40 | ||
}}</ref> | }}</ref> | ||
some layers are still missing styling-support - which basically means identifying everything that is currently hard-coded but styling related (think colors, fonts, sie, images/artwork) and replacing that with a variable, the same variable should be added to the df_style (default style) of the symbol, and then you need to set up a cache entry specifiying the symbol specific variables (e.g. color and fontsize), so that the styleable-cache can tell if it has a certain variant of a symbol or not | |||
map-canvas.xml is a simple example, artix's Airbus style is more sophisticated.<ref>{{cite web | |||
|url = https://forum.flightgear.org/viewtopic.php?p=297587#p297587 | |||
|title = <nowiki> Re: [SOLVED] How to modify symbols in MapStructure layers </nowiki> | |||
|author = <nowiki> Hooray </nowiki> | |||
|date = Oct 27th, 2016 | |||
|added = Oct 27th, 2016 | |||
|script_version = 0.40 | |||
}}</ref> | |||
For example, open the VOR.symbol file and see how it sets up a default style hash (df_style) here: https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Nasal/canvas/map/VOR.symbol<ref>{{cite web | For example, open the VOR.symbol file and see how it sets up a default style hash (df_style) here: https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Nasal/canvas/map/VOR.symbol<ref>{{cite web | ||
Line 1,033: | Line 1,044: | ||
relevant_keys: ["line_width", "color"], # supported style-able attributes | relevant_keys: ["line_width", "color"], # supported style-able attributes | ||
); | ); | ||
You can find more sophisticated examples in the Airbus style created by Artix, he also had to touch a bunch of MapStructure files to make that work. | |||
</syntaxhighlight> | </syntaxhighlight> |