Page 1 of 2

Posted: Sun Apr 18, 2010 3:16 pm
by Bunnywabbit
Hi,

We've had importimagefromfile, the png- enabling equivalent of importImage - for some time now.

However we don't have an equivalent for importimage3d.

This is the function that lets you dynamically change the colors in a given image to a colorvalue (e.g. hudColor) given as an argument.
i mention this here, because Ksero's mdl documentation does not.

for instance: the coloring of the background in the vanilla targetoval is handled by :

Code: Select all

TargetOvalColor = ImportImage3D("targetovalcolorbmp", targetHudColor, true);
It would be nice to have a importimagefromfile3d equivalent so we could
a) oneday completely switch to .png rather than bmp mdl
b) allow nifty shinyness to be applied to new huds.

thanks

Posted: Mon Apr 19, 2010 4:04 am
by KGJV
Bunnywabbit wrote:QUOTE (Bunnywabbit @ Apr 18 2010, 05:16 PM) Hi,

We've had importimagefromfile, the png- enabling equivalent of importImage - for some time now.

However we don't have an equivalent for importimage3d.

This is the function that lets you dynamically change the colors in a given image to a colorvalue (e.g. hudColor) given as an argument.
i mention this here, because Ksero's mdl documentation does not.

for instance: the coloring of the background in the vanilla targetoval is handled by :

Code: Select all

TargetOvalColor = ImportImage3D("targetovalcolorbmp", targetHudColor, true);
It would be nice to have a importimagefromfile3d equivalent so we could
a) oneday completely switch to .png rather than bmp mdl
b) allow nifty shinyness to be applied to new huds.

thanks
AFAIK I didn't add one because we can :

Code: Select all

TargetOvalColor = ImportImage3D(ImportImageFromFile("targetovalcolor.png",true), targetHudColor, true);
or

Code: Select all

targetovalcolorbmp = ImportImageFromFile("targetovalcolor.png",true);
TargetOvalColor = ImportImage3D(targetovalcolorbmp, targetHudColor, true);

Posted: Mon Apr 19, 2010 12:18 pm
by Bunnywabbit
both of those techniques crash the game.

The only way that works if if the ImportImageFromFile is in a separate textmdl in the artwork folder. Then you can import that using ImportImage3D.

unless my code has errors, but i did doublecheck it multiple times.

CODE
ShieldPic =
ImportImageFromFile("mods/Immersion/media/InHud_Shield.png", true);

InHudShield =
BlendImage(
ImportImage3D(
"InHud_Shield", //a text-mdl in Artwork: ImportImageFromFile("mods/Immersion/media/InHud_Shield.png", true)
//ShieldPic, //this crashes the game.
//ImportImageFromFile("mods/Immersion/media/InHud_Shield.png", true), // this crashes the game too.
hudColor,
true
),
BlendModeAdd
);

InHudCenterHudOn =
GroupImage ([
TranslateImage(InHudShield, Point(320,240))
]);



the point is starting to get slightly moot, however, since it appears to only be impossible to have this kind of coloring effect for static elements, not say, Gauges.

Unless ofcourse you could whip that up as well :)

Posted: Mon Apr 19, 2010 12:48 pm
by KGJV
Bunnywabbit wrote:QUOTE (Bunnywabbit @ Apr 19 2010, 02:18 PM) both of those techniques crash the game.
I'll look into that. they shouldn't.
Bunnywabbit wrote:QUOTE (Bunnywabbit @ Apr 19 2010, 02:18 PM) the point is starting to get slightly moot, however, since it appears to only be impossible to have this kind of coloring effect for static elements, not say, Gauges.

Unless ofcourse you could whip that up as well :)
I dunno, that whole alpha/transparency is kinda a fortunate 'side effect' of the new engine. I'll look into Gauge code to see why.

Posted: Mon Apr 19, 2010 12:54 pm
by Bunnywabbit
Thanks a lot,

I really appreciate your help!

Posted: Mon Apr 19, 2010 1:36 pm
by KGJV
KGJV wrote:QUOTE (KGJV @ Apr 19 2010, 02:48 PM) I'll look into that. they shouldn't.
they should actually ... 1st parameter of ImportImage3D must be of type String. I thought it could be any expression that evaluate to an image.My bad.

so text mdl like you did is the only way to load a png with ImportImage3D.

AS for Gauge, try with GaugeImageRect instead of GaugeImage may be ? (check forums for GaugeImageRect too, some known issues here).

Posted: Mon Apr 19, 2010 2:07 pm
by Bunnywabbit
allright then. So is this going in the suggestion box?


wrt to the gauges: tried that already, didn't work :) . Bit of a shame, because i had a really sweet idea for a HUD...

Posted: Tue Nov 30, 2010 4:28 pm
by Bunnywabbit
bump.

shall i make a ticket, then?

Posted: Tue Dec 07, 2010 12:22 pm
by Imago
yes, please make a ticket. :lol:

not all depths are supported, color related code NYI, etc, etc

EDIT: IIRC Bunny and I have been down this road once before - and we were able to get-r-done.

Posted: Sat Dec 11, 2010 9:50 am
by Bunnywabbit
Imago wrote:QUOTE (Imago @ Dec 7 2010, 01:22 PM) yes, please make a ticket. :lol:

not all depths are supported, color related code NYI, etc, etc

EDIT: IIRC Bunny and I have been down this road once before - and we were able to get-r-done.
I've been nagging about Transparency for a while now, because i believe the visuals turn a lot of potential new players off, and we need better ones. A lot of work has been done on models and textures, but it's all kind of moot if the interface still looks like something out of Buck Rogers.

(sigh: google images Buck Rogers for the not-as-old-as-I-am)

I don't recall we actually got something done. It's more like we hit upon a workaround. One that I'm using rather a lot now in the Glass Hud. I'd prefer however not to litter importmdls all over the artwork folder.