小编Hua*_*uae的帖子

在 JavaFX 画布上绘制大量动画形状时如何优化渲染性能

我在 HTML5 演示中使用 Javafx 实现相同的效果,但使用 Javafx 的帧速率非常低

我如何优化它,我是否写错了或者是否有其他更好的方法来实现它。

这是原始的 html5 演示项目:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>snows</title>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        .container {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
</head>

<body>
    <div id="jsi-snow-container" class="container"></div>

    <script>
        var RENDERER = {
            SNOW_COUNT: { INIT: 100, DELTA: 1 },
            BACKGROUND_COLOR: 'hsl(%h, 50%, %l%)',
            INIT_HUE: 180,
            DELTA_HUE: 0.1,
            init: function () {
                this.setParameters();
                this.reconstructMethod();
                this.createSnow(this.SNOW_COUNT.INIT …
Run Code Online (Sandbox Code Playgroud)

graphics performance javafx canvas draw

5
推荐指数
1
解决办法
82
查看次数

标签 统计

canvas ×1

draw ×1

graphics ×1

javafx ×1

performance ×1