[Python] Extend modules of ScriptWindow

  • This module was not designed for people who don't know nothing about python.
    Here is a simple functions which gives you the chance to be able to turn all objects of script loader (uiScript) into a a simple list and control all very simple.
    This is more easy if you have a lot a objects and want to do some actions with them like set multiples text, load images etc. do a simple loop by range start:end and you can play with it.

    • self.OBJECT_MAX_NUM = 25 | You can change how many max objects you can send into list.
    • self.Realloc(state, objectList) | You can run a action (Hide() / Show()) for all objects what you sended on list.

    How to use GetChildList([]):


    • How to use self.Realloc(None, []):


    How you can play with GetChildList, another example:



    Python
    1. for (key, object) in enumerate(self.GetChildList(["TextLineA", "TextLineB", "TextLineC"])):
    2. object.SetText("Format line: {0}".format(key))


    Code (Is a little shit, i was write on some minutes for test something, so i was think it's ok if i share with you because i don't use)


    .

    3 Mal editiert, zuletzt von VegaS ()

  • Dieses Thema enthält 2 weitere Beiträge, die nur für registrierte Benutzer sichtbar sind, bitte registrieren Sie sich oder melden Sie sich an um diese lesen zu können.