Hi all !!!
I've been working on a number of tweaks to a HUD (specifically it happens to be the Chupacabra HUD). And the tweaks I'm concentrating on at the moment are all related to
[color=#0000FF]'comm_log_gui'[/color]
and
[color=#0000FF]'message_gui'[/color]
.
I had mentioned previously - here in this thread, and also in the Chupacabra HUD's own thread - that I was intending to start a NEW thread to publish my tweaks and findings. However, while in the middle of the tweaks and tests, I've changed my mind about the 'NEW' thread bit. So that, whatever I end up publishing about HUD's - be it specific to the Chupacabra or maybe applicable to other HUDs - will be placed in
this very thread here.
Depending on how all of this goes along, I might consider changing the thread's name as well, to something more generic like "HUD tweaks" [thx to
CSOTB for the suggestion !
].
My initial and quite pretentious idea was simply to publish a set of snippets and a corresponding set of screenshots. But as the work progressed and progressed and progressed, with no end in sight, I felt I should reassess and reframe the whole idea.
Main reasons for this were:
. . . - there are multiple ways to skin a cat (i.e., different coding snippets to arrive at similar results);
. . . - the same snippet would probably cause different results for different users due to differences in OSes, graphic chipsets & cards, driver versions, monitor resolutions, fullscreen x windowed mode, etc. etc.;
. . . - many of the experimentations I was doing were not clearly documented at
http://wiki.alioth.net/index.php/Hud.plist .
So while my actual code-test-recode-retest saga is still a WIP (RL issues of all sizes and a good bit of laziness are the main stumbling blocks
), I feel I could start at once posting some
comments about some Wiki entries.
Let it be clear that I'm not trying to 'correct' or 'complete' the Wiki entries. Pls consider these as mere random notes from some un-knowledgeable user making empirical tests based on the current Wiki descriptions.
So, here we go.
1 - origin vs. origine (already FIXED in the Wiki)while [b]x_origin[/b]
and [b]y_origin[/b]
seem to be the correct labels, there are additional mentions to [b]x_origine[/b]
and [b]y_origine[/b]
(typos ?) which can be a bit misleading.
2 - y_origin
conflicting statements (already FIXED in the Wiki)Code: Select all
one of these is probably wrong:
y_origin = -1.0 means that y is relative to the screen bottom.
y_origin[e] = -1.0 means that the y co-ordinate is interpreted relative to the top of the screen.
3 - background_rgba
undocumented placement (see Eric Walch's comment, 2 posts below, with possible reasons for the omission)while [b]background_rgba[/b]
is given as a coding element for 'comm_log_gui'
only, I found thru experimentation that it also works under 'message_gui'
(but it's not mentioned there).
4 - [s]background_rgba[/s]
default values (the Wiki example now shows the DEFAULT value)one of my tweaks revealed that, after commenting out the 'background_rgba'
entry that came with the Chupacabra HUD under 'comm_log_gui'
, the end result became visually much more pleasing - it seems that the default values for 'background_rgba'
came into play. However I couldn't find WHICH are such default values - if these would be published, a lot of future trial and error interactions could be skipped when trying to tweak these values.
5 - background_rgba
color tips
6 - and, finally, voilá - The Black Art of GUI Positioning:
In order to correctly place either
'comm_log_gui'
or
'message_gui'
in the positions we want, we have to fiddle with no less than
SIX parameters: Code: Select all
x & y
x_origin & y_origin
width & height
while all six parms are somewhat individually documented in the Wiki, there's a
devilish undocumented interaction among them which caused me no end of tweaks and tests. I'm currently in the middle of this process, which will now (at least I do hope so) become a bit easier, thru my discovery mentioned
in #03 above... and yeah, now we could call
'background_rgba'
the SEVENTH 'magic' parameter, which will allow one to actually SEE the originally invisible borders of
'message_gui'
. It can be commented out again AFTER the final gui location is determined, in order to achieve the original transparent effect.
So, my TOTALLY EMPIRICAL (and somewhat incomplete) tests led me to the conclusions below -
someone else's validation would be welcome here, and it would be even better if some form of this (after the required corrections of course) could find its way into the Wiki. Let's see then:
6ACode: Select all
when 'x_origin = -1' (meaning that "the horizontal reference point is the LEFT side border of the screen"):
the 'x' (positive) value determines the HORIZONTAL OFFSET between the LEFT side border of the screen and the RIGHT side border of the GUI;
a negative 'x' value is INCORRECT (placing the RIGHT side border of the GUI off the screen, further to the left of the LEFT side border of the screen).
the 'width' (positive) value determines the HORIZONTAL OFFSET between the RIGHT side border of the GUI and the LEFT side border of the GUI.
6BCode: Select all
when 'x_origin = 1' (meaning that "the horizontal reference point is the RIGHT side border of the screen"):
the 'x' (positive) value determines the HORIZONTAL OFFSET between the RIGHT side border of the screen and the LEFT side border of the GUI;
a negative 'x' value is INCORRECT (placing the LEFT side border of the GUI off the screen, further to the right of the RIGHT side border of the screen).
the 'width' (positive) value determines the HORIZONTAL OFFSET between the LEFT side border of the GUI and the RIGHT side border of the GUI.
6CCode: Select all
when 'x_origin = 0' (or when the parameter is ABSENT) (meaning that "the horizontal reference point is the horizontal CENTER of the screen"):
the 'x' value determines the HORIZONTAL OFFSET between the horizontal CENTER of the screen and the OUTWARD lateral border of the GUI, as follows:
an increasingly POSITIVE 'x' value shifts the OUTWARD lateral border of the GUI further to the RIGHT of the horizontal CENTER of the screen;
an increasingly NEGATIVE 'x' value shifts the OUTWARD lateral border of the GUI further to the LEFT of the horizontal CENTER of the screen;
the 'width' (positive) value determines the HORIZONTAL OFFSET between the OUTWARD lateral border of the GUI and the INWARD lateral border of the GUI.
6DCode: Select all
when 'y_origin = -1' (meaning that "the vertical reference point is the BOTTOM border of the screen"):
the 'y' (positive) value determines the VERTICAL OFFSET between the BOTTOM border of the screen and the TOP border of the GUI;
a negative 'y' value is INCORRECT (placing the TOP border of the GUI off the screen, further BELOW the BOTTOM border of the screen).
the 'height' (positive) value determines the VERTICAL OFFSET between the TOP border of the GUI and the BOTTOM border of the GUI.
6ECode: Select all
when 'y_origin = 1' (meaning that "the vertical reference point is the TOP border of the screen"):
the 'y' (positive) value determines the VERTICAL OFFSET between the TOP border of the screen and the BOTTOM border of the GUI;
a negative 'y' value is INCORRECT (placing the BOTTOM border of the GUI off the screen, further ABOVE the TOP border of the screen).
the 'height' (positive) value determines the VERTICAL OFFSET between the BOTTOM border of the GUI and the TOP border of the GUI.
6FCode: Select all
when 'y_origin = 0' (or when the parameter is ABSENT) (meaning that "the vertical reference point is the vertical CENTER of the screen"):
the 'y' value determines the VERTICAL OFFSET between the vertical CENTER of the screen and the OUTWARD vertical border of the GUI, as follows:
an increasingly POSITIVE 'y' value shifts the OUTWARD vertical border of the GUI further ABOVE the vertical CENTER of the screen;
an increasingly NEGATIVE 'y' value shifts the OUTWARD vertical border of the GUI further BELOW the vertical CENTER of the screen;
the 'height' (positive) value determines the VERTICAL OFFSET between the OUTWARD vertical border of the GUI and the INWARD vertical border of the GUI.
Well, now I'm expecting someone to tell me I figured this all wrongly (really, I MEAN it !!!
) and of course suggest a proper rewrite of the offending statements. We'd all learn quite a bit BTW.
Cheers
EDITs:
- replaced a couple of words with others with more appropriate meanings.
- added statements: 'notes 01, 02 and 04 now fixed', 'note 03 under discussion'.