HISE Logo Forum
    • Categories
    • Register
    • Login

    Printing Viewport view positions?

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 115 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.
    • VirtualVirginV
      VirtualVirgin
      last edited by VirtualVirgin

      I can't seem to get the control callback to print the view positions of the Viewport dynamically.

      HiseSnippet 859.3ocsV08SSDDDe2ROzdpwOhO3iW3ohZvqUPnRLVo.ZiB1XQB9DY6dSoa3tcub2VvFi+O6+A5r2cs2gsBXi1GZ5ryW+1Y9My1NQJNDGqhHT6CFEBD5ss5NRpGzZ.SHIs2lPuq0gB37PUj1QCwZxViBYwwfGgRW3sFinUJSR97iWuEymI4P9QDxgJAG9fHPnyOsSy2K782k4AGHBJX8pMayUxVJe0PDPKX4RBY7SYm.6yLlUxh7NV7.B8wVb9pMfM5Wec25Mf07VsW8Ztr5tMZrNvVyk2qAvp2uG2kPWbGOgVE0UyPziAcKk2ntCTmKSSvghXQOevHTizEyb5wjVCD9dcFWchIDZ4N40pERqUOzZOgmXx440r6knvI2ihEMZoKCR09KfDs.jJmBo6a0kGIB04ZL34VVskZHpOC6MEgRpsjR2njUKEZgTuR.6TX2HTXhGUegq6ScvuVdSaa6m8rDZfPdhyYY7BaroEqcNiE4LlpTy4UNii3IftkJHTIQgpKMwhkLgahzJwFqj5HkeKlueOruWUIGqNSC5gP5KjfS+gRtVnjNSYSU93b8TDQ9Cgks+lcETYrxGVILRX.gA4NgpXQRL95KcVx4I4X2f3Ta5jYxQKsLl6KOJitxn7kjn78MsKf98UZ3ixpIfz961N+tp98motrKqODMS0lwpnKywpxgA8fnhkHigHM5hbyEudbSdZqtfgJYaoP+wPHSdWkumgyY98zLYRFWwvoyPHZpNgQ+fLFM3MtzRDdFJ8jJMI4RTboC4ys2loYiCGFYLagPjVXtTzsgyvkRoCLUr1FhOUqBSrMi5fW7qcx+Zdh2u4nbg1MOW3owsUVzlTBY.HNYf1H8HpYE3TSt3NCk2Pel9hKRLqXyTfcvKL8ZlPkH0ZTwUv+91kx+4NnagN3Uzetlv89VcDZ9fYi2Ry.uXG5+Mdy1UeGqc52G35bvV1Z2itzEy+afxmTCMaK2ioiDHWwZ+gAcw223.hDoD7iMbhRlYfTYWiroxzEjdIB+D+jorlQllor1Xkj.FORcLOcxw7xvMSNAwjL4kyJV6YjclwnR.9P0wb9EC0TNVedc74yqiqNuNt1753KlWGWedcbiq1Qy+i3MC0pfzwIBYuN6jrZiR2QxP1XByk7KbJLvP.
      
      // testing viewport
      const var Viewport1 = Content.getComponent("Viewport1");
      
      Viewport1.setControlCallback(onViewportControl);
      inline function onViewportControl(component, value)
      {
      	Console.print("view position x: " + Viewport1.get("viewPositionX"));
      	Console.print("view position y: " + Viewport1.get("viewPositionY"));
      };
      

      Is this not the way to do it?

      You can listen to my orchestral mockups here:
      https://www.virtualvirgin.net/

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

        @VirtualVirgin The viewport's changed callback isn't called when moving the scrollbars. It's called when the viewport is in list mode and you select an item in the list, or when you call .changed()

        I just tried attaching a broadcaster to the the property, but that doesn't work either - smells like a bug there @Christoph-Hart

        The only things I can suggest trying are a mouse broadcaster or using a timer to poll for changes.

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

        VirtualVirginV 1 Reply Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin @d.healey
          last edited by

          @d-healey said in Printing Viewport view positions?:

          @VirtualVirgin The viewport's changed callback isn't called when moving the scrollbars. It's called when the viewport is in list mode and you select an item in the list, or when you call .changed()

          I just tried attaching a broadcaster to the the property, but that doesn't work either - smells like a bug there @Christoph-Hart

          The only things I can suggest trying are a mouse broadcaster or using a timer to poll for changes.

          Thanks, I think I'll just leave it alone for now.
          I was hoping to use it somehow as a workaround to get scroll wheel events since the panel mouseCallback does not have this data.
          And that I was hoping to use as a workaround for the fact that the Viewport obscures the scrollbars when the content inside is lager than 2 dimensions.
          So I think for the time being I will have to stick either a panel with scrollbars (and no scroll wheel) or a viewport with scroll wheel and no scroll bars.
          Otherwise I guess I would have to learn how to edit the HISE source code, but that seems like a steep learning curve for me at the moment.

          You can listen to my orchestral mockups here:
          https://www.virtualvirgin.net/

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          23

          Online

          1.8k

          Users

          12.0k

          Topics

          104.8k

          Posts