HISE Logo Forum
    • Categories
    • Register
    • Login

    Change Text Colour on Hover and Clicked using PaintRoutine

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 171 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.
    • Tania GhoshT
      Tania Ghosh
      last edited by

      I am bit stuck on this code.. How can I change Text Colour on Hover and Clicked using Paint Routine.

      const var openwebsite = Content.getComponent("openwebsite");
      
      openwebsite.setPaintRoutine(function(g)
      {
       
          g.setColour(Colours.darkgrey);
          g.setFont("Arial",24);
          g.drawText("Open Website", [0,0,this.getWidth(),this.getHeight()]);
          
       });
      
      
      openwebsite.setMouseCallback(function(event)
      {
      	if(event.clicked)
          
      	    Engine.openWebsite("https://www.google.com");
          
      });
      

      Tania Ghosh

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User
        last edited by

        Link Preview Image
        HISE | Scripting | Script Panel

        The reference guide for the ScriptPanel

        favicon

        (docs.hise.audio)

        Add another if statement to the MouseCallback

        if(event.hover) 
        
        //change colour
        
        Tania GhoshT 1 Reply Last reply Reply Quote 1
        • Tania GhoshT
          Tania Ghosh @A Former User
          last edited by

          @iamlamprey Superb got it.
          Thank you.

          Tania Ghosh

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

          24

          Online

          1.8k

          Users

          12.0k

          Topics

          104.4k

          Posts