Page 1 of 1

Available global variables/parameters?

Posted: Tue Nov 13, 2012 12:45 pm
by Gambit37
I don't really understand the "global" parameters listed on most functions.

There's a lot of stuff passed into functions such as where, ppos, sel_ppos, mx, my, etc. Are these global variables that are always available to every function?

I used the mx and my variables without really understanding where they came from to detect the current mouse position, and it "just worked" :-) But I don't fundamentally understand how these really work, and what variables might actually be available for use. Could you explain this and perhaps also provide a list of these globals? (if I've understood that concept correctly, anyway!)

The more I tinker in DSB, the less I realise I understand...

Re: Available global variables/parameters?

Posted: Tue Nov 13, 2012 7:12 pm
by Sophia
No, they aren't global at all. :)

Those are simply parameters passed to the function. So, the answer as to what is available is-- whatever is being passed. If you were using a rendering function or something that took mx and my parameters, then the function would of course work because it had those parameters.

What I think you're really asking is, "Is there a coherent list of the formal parameters for each of DSB's functions?" and the answer is "not exactly; the wiki has a fairly decent reference, but I'm sure some stuff is missing."

By the way, please don't use yellow text. I use a light background and I can barely read it. :)