Posted: Fri Aug 14, 2009 9:25 am
As some of you might know there is an issue that doesn't allow GaugeImage calls to work as they used to in R5.
Example:
Although the above used to work with R4, now that R5 is on the way there is a problem with the above call. Specifically, when the value of the specific gauge is reduced, it's image is truncated from the bottom instead from the top (of course I am talking about using it with JustifyBottom, as demonstrated on the example above).
From left to right, Energy Full, Energy low R4 way (correctly displayed truncated from top), Energy low R5 way (wrongly displayed truncated from bottom):
Also, some of you might use the following to do the same job since it does not suffer from the truncated from bottom issue:
This has a side effect in R5. The gauge will appear semitransparent.
Imago tried to locate the source of these issues in R5 but due to the complexity of the code and Imago's limited available time for this, a fix was not found and another pointed out the correct method to call the gauge, that doesn't suffer from any of the above issues.
ALL you need to do is wrap your calls into BlendImage calls.
For the 1st case you can do this:
For the 2nd case you can do this (although this crushes R4, so you have to wait for R5):
Example:
Code: Select all
parciEnergyGauge =
GaugeImage(
JustifyBottom,
ImportImageFromFile("mods/CortUI/media/cortui_parci_energy.png", true),
GetPercentEnergy(Me, OnEveryFrame)
);From left to right, Energy Full, Energy low R4 way (correctly displayed truncated from top), Energy low R5 way (wrongly displayed truncated from bottom):
Also, some of you might use the following to do the same job since it does not suffer from the truncated from bottom issue:
Code: Select all
parciEnergyGauge =
GaugeImageRect(
JustifyBottom,
ImportImageFromFile("mods/CortUI/media/cortui_parci_energy.png", true),
Rect(0, 0, 19, 82), // which part of the image to use
true, // this set 3D mode
GetPercentEnergy(Me, OnEveryFrame)
);Imago tried to locate the source of these issues in R5 but due to the complexity of the code and Imago's limited available time for this, a fix was not found and another pointed out the correct method to call the gauge, that doesn't suffer from any of the above issues.
ALL you need to do is wrap your calls into BlendImage calls.
For the 1st case you can do this:
Code: Select all
parciEnergyGauge =
BlendImage(
GaugeImage(
JustifyBottom,
ImportImageFromFile("mods/CortUI/media/cortui_parci_energy.png", true),
GetPercentEnergy(Me, OnEveryFrame)
),
BlendModeAdd
);For the 2nd case you can do this (although this crushes R4, so you have to wait for R5):
Code: Select all
parciEnergyGauge =
BlendImage(
GaugeImageRect(
JustifyBottom,
ImportImageFromFile("mods/CortUI/media/cortui_parci_energy.png", true),
Rect(0, 0, 19, 82), // which part of the image to use
true, // this set 3D mode
GetPercentEnergy(Me, OnEveryFrame)
),
BlendModeAdd //hudBlendMode
);