View Full Version : lost in the G4 OSD jungle

May 31st, 2006, 02:56 PM
I am trying to get a grip of the G4 OSD but some weird things are happening. The osd.StatusMessage from the OSD Examples GML works but does not fade at all.

local osdsettings = osd.GetStyle ("StatusLightRed",{Fade=true,Position = "CENTERWCENTERH",TimeOut = 2000,Transparency=50,FontAutoSizeWidth = 10})
osd.StatusMessage ("Big Red OSD",osdsettings)

And there are references to the osd.lua that do not exist there. While I found a more sophisticated osd.lua in the forums, mine from the G4 install seems kind of crippled.

TreeScript example
Ron Bessems

treescript.Action[1].OnAction=function ( Action, Event )

local settings = table.copy(osd.Styles.StatusLightBlue) -- make a copy of the table, the line above is just a reference. Thanks John.
settings.Position = 'NEARBOTTOMCENTERW'
settings.Monitor= Action.sValue2
settings.FontSize = Action.sValue3
osd.StatusMessage( gir.ParseString(Action.sValue1),settings)
return true, "OSD Displayed"

return "ts-osd.xml"

thatīs all there is. any help appreciated


June 16th, 2006, 12:15 PM
I guess I was a litle bit vague. So here some more explicit questions:

- is the above posted file the correct osd.lua file in the
treescript directory?

- if yes, where do I find the built in OSD classes and all the references
("... look in the osd.lua file for more information.....") ?

- why is it that the OSD does not fade? (I got it working for the progress
bar class though, but not yet for the text message)

ok gentlemen, I am not complaining at all that there is no "click and go osd for dummies" anymore in G4 but some pointers would be an excellent start.

txs in advance:-)


June 16th, 2006, 05:03 PM
I would say there is a "click and go osd for dummies". Girder->OSD. Will do just fine for most people. If you want more advanced stuff you need to dive in.

OSD.lua is not available in source at the moment.

The reason why the OSD doesn't fade is because it is being destroyed as opposed to hidden. So the example below hides the OSD on timeout and then also fades it.

if MyOSD then

local settings = table.copy(osd.Styles.StatusLightBlue) -- make a copy of the table, the line above is just a reference. Thanks John.
settings.Position = 'NEARBOTTOMCENTERW'
settings.Monitor= 1
settings.FontSize = 12
settings.Fade = true
settings.DontDestroy = true
settings.Text = 'HEllo;'
MyOSD = osd.Classes.Text:New(settings)

June 17th, 2006, 06:07 AM
Thanks for answering - I will jump:-)

OSD.lua is not available in source at the moment
does that mean I just canīt see it or itīs not there? without having an extended osd.lua in the lua/startup folder (osd_149.lua from the forum), even the basic osd.image class is not working.

here is what I want to do: in order to have a very sleek volume osd I am going to use an image and resize it. I have it (almost)working like that:

h = win.FindWindow("OsdClassName",nil)
win.SetWindowPos(h,win.HWND_TOP, 200, 30, vol, 220, win.SWP_SHOWWINDOW)
the fading effect is smoother and the fading speed is adjustable but if you have several osdīs (e.g. text, value and bar), it affects all of them.

so I tried to use the low-level OSD functions:

imageA = osd.Classes.Image:New({TimeOut=0, Fade=true,Transparency=230})
but unfortunately, it does not let me do that either. How could I fade, resize and position different osd images and text boxes seperately? that would be perfect!

June 17th, 2006, 08:27 AM
.....some progress with the text boxes. I have them completely transparent only showing the text at the right position.

local fontc = osd.MakeARGB(255, 100, 100, 100)
local trans = osd.MakeARGB(0,200,200,200)

settings.X = 50
settings.Y = 50
settings.FontColor = fontc

But I could not find any solution or hint for the following issues:

- when they fade out (what they fortunately do now!), you see the before transparent background because it fades through black?!?

- when I change the transparency of trans from 0 to 1 the background is just plain black. when I increase it further, the actual colour comes out

- is there a way to left align text in the osd and use tabs?

thanks again in advance (I have come a long way with girder but I never felt as uninformed as with this osd)


June 22nd, 2006, 06:50 AM
mhhh. I was trying to be as descriptive as possible but maybe a litle summary helps:

- how do I get the "osd.Classes.Image" to work without an additional osd.lua file?

- can low level osd functions such as "imageA:Position(100,200)" be used to manipulate mid level osdīs such as "imageA = osd.Classes.Image:New...."?

- is there a way to fade out the status osd where the invisible background stays invisible during fading?


June 22nd, 2006, 09:35 AM
hi, you do not need the osd.lua file (its included with G4 and precompiled). So the image class should work.

let me know if you would like the osd.lua to look at. Ron and I don't have much free time to help with you right now. :( sorry.