Changes

Jump to navigation Jump to search
308 bytes removed ,  23:19, 7 March 2011
adapt to recent theme parser changes
=== Resolution-dependent keys and layouts ===
Several keys in the STX syntax support the <tt>resolution</tt> property, which allows to load or skip the key and all its children when loading the theme on a given resolutiondimension limit.
The resolution property must contain one or more resolutionsresolution dimension limits, comma separated, for which the given key is supposed to be loaded. Resolutions preceded by the minus sign will block the key from being loaded in that resolution, while resolutions without any modifiers will force the theme to be loaded in all resolutions. Here are a few examples:
<syntax type="xml">
<render_info>
/* Key will ONLY be loaded in resolutions with 320 400 width or more */<render_info resolution = '320xYy>399'>
/* Key will ONLY be loaded in resolutions with 240 less than 400 height and in the 320x200 resolution */<render_info resolution = 'Xx240, 320x200'> /* Key will be loaded on ALL resolutions except for 320x200 */<render_info resolution = '-320x200'> /* Key will ONLY be loaded in resolutions with 320 width; the -240xY is superfluous. */y<render_info resolution = '320xY, -240xY400'>
</syntax>
<syntax type="xml">
<def var = 'TestVar' value = '100'/>
<def var = 'TestVar' value = '200' resolution = '320xYy>399'/>
</syntax>
won't fail to parse. What will happen when loading the theme using a resolution with 320 width 400 height or mire is that <tt>TestVal</tt> first will be assigned the <tt>100</tt> value, and then it will be overwritten with the <tt>200</tt> value. On the other hand, when loading the theme using a resolution ''withoutwith less'' a with of 320than 400 height, the <tt>ThemeVal</tt> will be assigned the <tt>100</tt> value and the second key will be plain ignored.
The &quot;proper&quot; way to do that multi-resolution assignment would obviously be:
<syntax type="xml">
<def var = 'TestVar' value = '100' resolution = '-320xYy<400'/><def var = 'TestVar' value = '200' resolution = '320xYy>399'/>
</syntax>
This way keys are only parsed on the resolution they are used in, but the result will be '''exactly the same''': Most of the time it's just cleaner to avoid using <tt>-320xYy<400</tt> resolution tags, and instead write a layout that works on all resolutions and overwrite parts of it with the '320xY' <tt>y>399<tt> tag.
24

edits

Navigation menu