[Suggestions] "class" attribute

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

[Suggestions] "class" attribute

Post 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
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
seeba
Posts: 255
Joined: 15 Jun 2010, 17:31
Contact:

Re: [Suggestions] "class" attribute

Post 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
Image
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest