Not logged inOpenClonk Forum
Up Topic Script Menus - Preliminary Documentation

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Zapper

>Would you comment on the example syntax I gave here?


I really have nothing against adding an exclusive notation for margins. But I think that the array notation for positions is only helpful in one case - when you have plain, relative coordinates like in your example.
- I don't feel that using nested arrays is the right thing to do when we want readability (Pos = [[500, -20], [23, -453]]). Especially if someone gets the idea to tag their positions.
- That way you would always have to give both coordinates. Currently, you can use the defaults (0, 0, 100%, 100%) a lot. I don't think I have many window definitions that define all four coordinates at the moment - especially if you ignore margins.
- You couldn't just do foo.X = 123; later in script. You would have to do foo.Pos[0]. And for that you'd have to make sure, that Pos is set: if (!foo.Pos) foo.Pos = [123, 0]; else foo.Pos[0] = 213;
The minimal gain we get in simple examples (Pos = [50, 420] instead of X = 50, Y = 420) does imo not make up the downsides coming from that notation.

Nevertheless, even with an extra margin-notation, I still favour the Left/Top/Right/Bottom notation. Not only because you have to do less manual math and at least I find it really comfortable to work with, but also because you can provide the scripter with sensible default values.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill