HISE Logo Forum
    • Categories
    • Register
    • Login

    Switch Images according to a button's values

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 206 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.
    • O
      Onik Sisodiya
      last edited by

      Hello Everyone, Can Anyone help me with switching the images of buttons from another button.

      For now I'm able to switch the image but there is something wrong as it doesn't change the image unless I reload the project

      I would appreciate if some can provide a snippet or an example that i go through and understand.

      Thanks

      inline function onDandLSwitchControl(component, value)
      {
      if(value){

      FXSlot2OnOff.set("filmstripImage", "{PROJECT_FOLDER}Layers_POWER_BUTTON_Yellow_72_X_144_X_2.png");

      LightModeImage.showControl(false);
      DarkModeImage.showControl(true);
      }else{
      FXSlot2OnOff.set("filmstripImage", "{PROJECT_FOLDER}MacroMacro_LightMode_POWER_BUTTON_Yellow_72_X_144_X_2.png");
      LightModeImage.showControl(true);
      DarkModeImage.showControl(false);
      }
      

      };

      Content.getComponent("DandLSwitch").setControlCallback(onDandLSwitchControl);

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

        You can't change these images dynamically. You'd need to have two different buttons for the two images and hide/show them as needed.

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

        O 1 Reply Last reply Reply Quote 0
        • O
          Onik Sisodiya @d.healey
          last edited by

          Thanks @d-healey

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

          9

          Online

          1.7k

          Users

          11.8k

          Topics

          102.3k

          Posts