3 Replies Latest reply: Apr 26, 2012 9:41 AM by David Grieve RSS

    Println

    931827
                  imageView = ImageView {
                      translateX: bind (scene.width - imageView.layoutBounds.width) / 2
                      translateY: bind (scene.height - imageView.layoutBounds.height) / 2
                      image: Image {
                                  backgroundLoading: true
                                  url: url
                                  placeholder: Image {
                                                   url: "{__DIR__}images/small.gif"
                                               }
                             }
                  }
      How can I check the value of : (scene.width - imageView.layoutBounds.width) / 2 using println or something different? Thanks for help!
        • 1. Re: Println
          802717
          I would try subclassing ImageView so you can override translateX. Then on translateX have an 'on replace', so:

          override var translateX on replace oldVal
          {
          println( "translateX changed from {oldVal} to {translateX}");
          }
          • 2. Re: Println
            931827
            Thank you very much! I would have never done it without your help :)
            • 3. Re: Println
              David Grieve
              It would be much easier to put the ImageView inside of a StackPane which takes care of centering things for you.

              Errp. Never mind. I see now this is 1.x forum, not 2.0.

              Edited by: dgrieve on Apr 26, 2012 7:40 AM