HISE Logo Forum
    • Categories
    • Register
    • Login

    Engine.createFixObjectFactory(var layoutDescription)

    Scheduled Pinned Locked Moved Scripting
    14 Posts 4 Posters 269 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ulrikU
      ulrik @Matt_SF
      last edited by

      @Matt_SF Ok, I'll have a go then, wish me luck

      1 Reply Last reply Reply Quote 0
      • ustkU
        ustk
        last edited by

        Not mentioning FixObjectArray and FixObjectStack... What are they?

        Can't help pressing F5 in the forum...

        ulrikU 1 Reply Last reply Reply Quote 1
        • ulrikU
          ulrik @ustk
          last edited by

          @ustk true...

          ulrikU 1 Reply Last reply Reply Quote 0
          • ulrikU
            ulrik @ulrik
            last edited by

            @ulrik Why I started searching in the API is because I need to find if an Object is inside an Array, and this will obviously not work

            if (Array.contains(object))
            

            but with the FixObj... function it seems to be possible?

            Skärmavbild 2022-12-08 kl. 13.05.58.png

            d.healeyD ustkU 2 Replies Last reply Reply Quote 0
            • d.healeyD
              d.healey @ulrik
              last edited by

              @ulrik

              and this will obviously not work

              Sure it will!

              const obj1 = {id:"obj1"};
              const obj2 = {id:"obj2"};
              const obj3 = {id:"obj3"};
              
              const a = [obj1, obj2, obj3];
              
              Console.print(a.contains(obj1));
              

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              1 Reply Last reply Reply Quote 2
              • ustkU
                ustk @ulrik
                last edited by

                @ulrik Of course you can search for an object:

                const var Panel1 = Content.getComponent("Panel1");
                
                const var array = [Panel1];
                
                Console.print(array.contains(Panel1)); //1
                

                Can't help pressing F5 in the forum...

                ulrikU 1 Reply Last reply Reply Quote 2
                • ulrikU
                  ulrik @ustk
                  last edited by

                  @ustk @d-healey
                  I din't explain so well, the objects in my example look like this

                  obj ={"name": "A", "children": []};
                  

                  the objects are in an array and I want to find out if the array contains an object that already has the same obj.name

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @ulrik
                    last edited by d.healey

                    @ulrik

                    inline function containsObject(array, key, value)
                    {
                    	for (x in array)
                    		if (x[key] == value)
                    			return true;
                    	
                    	return false;
                    }
                    
                    HiseSnippet 778.3ocsU01SaCCD1tzfVxdQCo8CvpepUpC0RYunUgFi9xT0FP0JCMIDB4l3PMM0txwgQEh+q6mv9GrcNokjBUcPkV9fUt64NmGe44N2UIcYggREBaezjwLD9YV8lHzCZLfxEnNMQ3WXsOMTyTjDW6MYLMLj4gv309rwA1NOJ942ebOZ.U3xRcgPGK4truxGw0od6t6W3AAsodri3ixD8161wUJZHCjQ.eVypBZL0cH8b1ATSX4rP30a4w0RUOMUyBgX1S5Mo2.4OEIweLOj2OfYLph5AaThaTiA7.utyNqgHDNe2zS9ZIm7WYsO2ieq+zJvKiAHoYjsFfysLJU8QPIbFJkOgRaX0yUwGqSQL74oVcDvODeJTpyRkjXQ49E1pgDhPn2bDcHqsBLtMihusRkxDXoTcGGnbGpIx9WTkrC4Zt2GJXduvM0SQ1JCxVygTKCRMCxTHJ3+Dy9TNN+30ZmBvbQ.WvH9QBWMWJHP3ZnFGdX+KXt5hTkhNoLYHCVtjFDwJ4bsisuTQJdEgKHw3kbrs49fmSf3NkryNyB011VwzQJAQqhX0crclY6SCBAG233.UkPY.aywJtPW7te9xjBbuBvZ7IsTo52RTo3.olcnnXLifchbWHe+EhY9MnjAAL0BgMxe0xRrnHZTelJa8vDHnOlWzs9CSz4lnJxDnTzQv0GNlM0tsLvyHlLueeIJZprBd66cZR0TipcpOHtwLklanCtI6RnsOQCaa0jENTKGCM92SfCsVRun.pd99Myfko.P8XNQtQHKB45IYG77HZBqrzlvGJE2vpKW6NXwbL2B3HTo9evwoitdtUKeePDmRv7Vs+wpNm5e74+lLRyEmuOUq3WgvVGDMpGLw1kAecgfE.atENmQsjXWwXap.8XBuXi+.OSAqZrwSAqNCDMh5pjm4lzEXFN9jXO.mDw2EXCWJA1jpn3NCHOqJaVAMBlSelqq43+ZP.u3b1ZExo1Jjy1qPNuYEx4sqPNuaEx48KMGyUjeJRKGkzN.N51JdDAF2RPAkUrJD8W.GaeT1.
                    

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    ulrikU 1 Reply Last reply Reply Quote 2
                    • ulrikU
                      ulrik @d.healey
                      last edited by

                      @d-healey Nice! Thank you :)

                      ulrikU 1 Reply Last reply Reply Quote 0
                      • ulrikU
                        ulrik @ulrik
                        last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        36

                        Online

                        1.7k

                        Users

                        11.9k

                        Topics

                        103.6k

                        Posts