JavaFX animations 🎬

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024

Комментарии • 31

  • @BroCodez
    @BroCodez  3 года назад +10

    package application;
    import java.net.URL;
    import java.util.ResourceBundle;
    import javafx.animation.FadeTransition;
    import javafx.animation.Interpolator;
    import javafx.animation.RotateTransition;
    import javafx.animation.ScaleTransition;
    import javafx.animation.TranslateTransition;
    import javafx.fxml.FXML;
    import javafx.fxml.Initializable;
    import javafx.scene.image.ImageView;
    import javafx.scene.transform.Rotate;
    import javafx.util.Duration;
    public class Controller implements Initializable{
    @FXML
    private ImageView myImage;

    @Override
    public void initialize(URL arg0, ResourceBundle arg1) {

    // translate
    TranslateTransition translate = new TranslateTransition();
    translate.setNode(myImage);
    translate.setDuration(Duration.millis(1000));
    translate.setCycleCount(TranslateTransition.INDEFINITE);
    translate.setByX(500);
    translate.setByY(-250);
    translate.setAutoReverse(true);
    translate.play();
    /*
    // rotate
    RotateTransition rotate = new RotateTransition();
    rotate.setNode(myImage);
    rotate.setDuration(Duration.millis(500));
    rotate.setCycleCount(TranslateTransition.INDEFINITE);
    rotate.setInterpolator(Interpolator.LINEAR);
    rotate.setByAngle(360);
    rotate.setAxis(Rotate.Z_AXIS);
    rotate.play();

    // fade
    FadeTransition fade = new FadeTransition();
    fade.setNode(myImage);
    fade.setDuration(Duration.millis(1000));
    fade.setCycleCount(TranslateTransition.INDEFINITE);
    fade.setInterpolator(Interpolator.LINEAR);
    fade.setFromValue(0);
    fade.setToValue(1);
    fade.play();
    // scale
    ScaleTransition scale = new ScaleTransition();
    scale.setNode(myImage);
    scale.setDuration(Duration.millis(1000));
    scale.setCycleCount(TranslateTransition.INDEFINITE);
    scale.setInterpolator(Interpolator.LINEAR);
    scale.setByX(2.0);
    scale.setByY(2.0);
    scale.setAutoReverse(true);
    scale.play();
    */
    }
    }

  • @rafaelvilaruel5112
    @rafaelvilaruel5112 3 года назад +12

    Bro, i'm in the middle of the 10hour Java Course and dang, you changed my Java Life forever! i was finding such a hard time to learn Java or even like the language. And your way of teaching and doing stuff literally changed everything. You literally changed my life lol. I can't wait to finish that video and start your other ones, build a lot of stuff, etc.
    Thanks man! I am already sharing your videos everywhere i can. If your channel died rn i would top myself

    • @BroCodez
      @BroCodez  3 года назад

      Thanks for sharing Rafael! I'm glad the videos are helping!

  • @kfdjhnhurjnnbjhu3ip410
    @kfdjhnhurjnnbjhu3ip410 3 года назад +5

    this channel is underrated👍

  • @cpu5468
    @cpu5468 3 года назад +2

    Can you please show us, how we can set a Backgroundimage to a Stage or a Scene?

  • @L83M73
    @L83M73 4 месяца назад

    Great video, would be wonderful if you could make a video that starts and stops an animated gif from buttons.

  • @adheesh2secondsago630
    @adheesh2secondsago630 3 года назад +1

    I would wish to donate for such a amazing course. You are amazing. Thanks Bro! ;)

  • @charlesdanny1824
    @charlesdanny1824 3 года назад +1

    Hi Brother, Huge thanks for all the course and I am learning a lot from your course and I am sure there are many others who are learning and will be building up a career in the Development area. I have a request, Please make all in one video for javascript.

  • @zomzhack
    @zomzhack 2 года назад +1

    Very useful video thanks

  • @techxzeal3999
    @techxzeal3999 3 года назад +1

    Sonic running so fast

  • @JehanSaren
    @JehanSaren Год назад

    Bro,please step forward into pure physics simulation animations.

  • @razvanmadar4432
    @razvanmadar4432 3 года назад +1

    how can I move that image to the right with 250px and leave it there?

    • @BroCodez
      @BroCodez  3 года назад +1

      myImage.setX(250);

  • @vedantdeshmukh4949
    @vedantdeshmukh4949 3 года назад +1

    Hi bro❤️❤️❤️❤️ Lots of respect 🙏

  • @benderbg
    @benderbg Год назад

    Its called Sonic the Hedgehog but you are forgiven xd

    • @foikhefesto1934
      @foikhefesto1934 3 месяца назад

      You lack internet culture basic knowledge my boy

  • @androidworld3239
    @androidworld3239 3 года назад

    how to save it as gif moving image

  • @phoenixone7450
    @phoenixone7450 3 года назад

    The single dislike is from the hedgehog who must have been feeling quite dizzy by the end of the video...

  • @jakeadams9973
    @jakeadams9973 3 года назад

    I was tasked with this assignment to do in scenebuilder, but i dont understand how to do it even though it seems simple can anyone help me?
    Create the alarm clock, that displays the current time in a label, that contains a textbox to put the time in, when it is that time you set off an alarm, by sound or visual. Use Timeline animation of 1 second.

  • @syllight9053
    @syllight9053 3 года назад

    WHO THE IS UNLIKING BRO'S VIDEO?

  • @bildadnyanga7215
    @bildadnyanga7215 2 года назад

    Can we achieve the same result using path Transition?

  • @BRANDONESNEIDERACEVEDOCASTANED

    Very sick tutorial man ;3

  • @cococ7128
    @cococ7128 2 года назад

    Thanks you so much for this video

  • @innocentBir
    @innocentBir Год назад

    Your all playlist is great Bro
    ❤❤

  • @niklasw6738
    @niklasw6738 2 года назад

    thank you brother

  • @rashakh5059
    @rashakh5059 2 года назад

    Thank you so much

  • @ethanalkout949
    @ethanalkout949 3 года назад

    Bro army ;)

  • @saifuddin395
    @saifuddin395 3 года назад

    Great content bro...

  • @sethg7336
    @sethg7336 3 года назад +1

    Thank you bro

  • @catakanggames3845
    @catakanggames3845 3 года назад

    Just want to say, this would have been the most helpful if this was uploaded a few days ago. It is still helpful because I finished the latest version of my project, but it would have been more helpful a few days ago.

  • @siavashnourmohammadi9189
    @siavashnourmohammadi9189 Год назад

    thank you a lot :