How to set x y width & height separately ?

Home Forums General Programming How to set x y width & height separately ?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11349
    zeoka
    Participant
      • Topics: 73
      • Replies: 466
      • Total: 539
      • ★★★

      Hi
      I try to do animations and i want to set positions and size separately from several mods
      Tried aa:setSize((xx),(yy)) to see , it’s ok (aa:panel:getComponent(“bb”)

      …and now i want to masterize setBounds and setBoundsRelative
      There is two setBounds in Juce but first (x,y,wi,he) seems don’t permit to put variables ( i’m surely faulty)and the second is not clear for me. Any suggestions ?
      aa:setBoundsRelative(3f,2f,1f,0.5f) console said error (malformed number)
      Tried several other things…

      Is it possible set separately X Y WIDTH HEIGHT of a component ?currently i don’t see anything about it
      I ‘ ve seen the demo panels example too but if i use getX() or getbounds() i’m lost
      because my graphic object(a group) position&size become relative

      If anyone can helps ?

      #11350
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        You can check out the Rendering demo and the Transfor and Animation demo. I just fixed them and uploaded a new nightly that fixes some issues with those demos and some Lua stuff.

        #11353
        zeoka
        Participant
          • Topics: 73
          • Replies: 466
          • Total: 539
          • ★★★

          Thank you !
          LUA is working now on r1514 🙂

          I’ve past some hours with examples and it seems i can’t get the render demo’s sliders x and y so easily ! It seems optXOffset slider is called optX in scripts so Offset.. ?? Same thing for other example (AffineTransform.rotation)..
          I can’t use variable as you can see…

                if accent == 0 then
                  stdes:setSize(104,24)
           elseif accent == 1 then
                  stdes:setSize(104,64+24)  
           elseif accent == 2 then
                   stdes:setSize(104,48+24)
           elseif accent == 3 then
                  stdes:setSize(104,24+24)      
           elseif accent == 4 then
                  stdes:setSize(104,24)
           elseif accent == 5 then
                  stdes:setSize(104,24+24) 
           elseif accent == 6 then
                  stdes:setSize(104,48+24)
           elseif accent == 7 then
                  stdes:setSize(104,64+24) 
              end

          I need to repositionning the Y of “stdes” component after resizing ( moved() ?) but not in full order !
          But the worst :2 others mods with other scripts would move the X and width !! and not in full order too o^O
          And if i do it i include a random.math value with loops for ramdomize bounds
          A lot of things..

          #11354
          atom
          Keymaster
            • Topics: 159
            • Replies: 2945
            • Total: 3104
            • ★★★★★

            Have you tired using setTopLeftPosition() method on the component, you are setting it’s size and not changing it’s Y coord.

            #11406
            zeoka
            Participant
              • Topics: 73
              • Replies: 466
              • Total: 539
              • ★★★

              Niiicccceee !!
              The µQ arp is more “organic” now

              The “held” lenght value set a witdth of a step to the x offset of the next
              Random timing set a random ( in a min-max timing range) x offset of the current step
              I’ve one script per step applied to 5 mods

              So we don’t see in this pic but all my steps can be animated !!

              Big thx Atom

              • This reply was modified 10 years, 9 months ago by zeoka.
              • This reply was modified 10 years, 9 months ago by zeoka.
              • This reply was modified 10 years, 9 months ago by zeoka.
              Attachments:
              You must be logged in to view attached files.
            Viewing 5 posts - 1 through 5 (of 5 total)
            • The forum ‘Programming’ is closed to new topics and replies.
            There is currently 0 users and 100 guests online
            No users are currently active
            Forum Statistics
            Threads: 2,495, Posts: 17,374, Members: 77,605
            Most users ever online was 12 on January 22, 2019 3:47 pm
            Ctrlr