本文主要是介绍javafx-Creating Visual Effects视觉效果,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
chainEffects代码可以参考链接设置
https://docs.oracle.com/javase/8/javafx/visual-effects-tutorial/visual_effects.htm#JFXTE191
https://docs.oracle.com/javase/8/javafx/visual-effects-tutorial/effect-types.htm#CIHDGIHF
package sample.main.onlyt.animation;
import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.geometry.VPos;
import javafx.scene.*;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.*;
import javafx.scene.shape.*;
import javafx.scene.effect.*;
import javafx.scene.paint.*;public class RotateTransitionExample extends Application {Stage stage;Scene scene;@Override public void start(Stage stage) {stage.show();scene = new Scene(new Group());ObservableList<Node> content = ((Group)scene.getRoot()).getChildren();content.add(chainEffects());stage.setScene(scene);}static Node chainEffects() {InnerShadow is = new InnerShadow();is.setOffsetX(2.0f);is.setOffsetY(2.0f);Text t = new Text();t.setEffect(is);t.setX(20);t.setY(100);t.setText("Inner Shadow");t.setFill(Color.RED);t.setFont(Font.font("null", FontWeight.BOLD, 80));t.setTranslateX(300);t.setTranslateY(300);return t;}public static void main(String[] args) {Application.launch(args);}
}
这篇关于javafx-Creating Visual Effects视觉效果的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!