Page 1 of 1

[Suggestions] "class" attribute

Posted: 07 Jul 2012, 17:29
by gouxim
Hello,

Today we can add and id="" attribute to a Manialink element and later retrieve it with

Code: Select all

Frame.GetFirstChild(Text)
What about adding the class="" attribute.
  • Id is unique
  • Class can be used on several elements, and several classes can be used on a single element
eg.

Code: Select all

<quad id="myquad" class="button some-other-class yet-another-class" />
Some notes:
  • Ideally ids and classes should have a stricter format. Eg (alphanum + .-_)
  • Frame.GetById and Frame.GetByClass could be used to retrive a Control and an array of Controls respectively
  • GetByClass should be recursive, with maybe the possibility to turn recursivity off with an optional parameter

Re: [Suggestions] "class" attribute

Posted: 07 Jul 2012, 18:16
by seeba
That sounds useful.
I think you can already have elements with the same ID and go through them via foreach or so. But then you can't address a specific one.
It would be cool if that could be added :D