爱意满满的作品展示区。
acbox

Newcar 2.0.0 Beta 发布!

  •  
  •   acbox · Jul 23, 2024 · 2300 views
    This topic created in 682 days ago, the information mentioned may be changed or developed.

    Newcar 2.0.0 Beta 版本发布!

    Newcar 在经历了原生 Canvas -> Skia 的进展过程将会在 2.0.0 版本结束,至此 Newcar 已重构完毕,相比于 1.0, newcar 用更优雅,性能更高的方式实现了内核的重写以及 API 的重设计

    Reactivity --- 响应式的按需更新

    我们模仿了 Vue 的响应式设计,并把它用在 Newcar 的按需更新上,让程序运行更加的高效

    const widget = new Widget()
    widget.x.value = 100
    

    缺点:需要使用 .value 进行值的访问和修改

    Setup 语法糖

    传统的动画需要一个一个进行 animate,而且修改单个值特别麻烦,有了 setup 语法糖,就可以通过生成器函数逐个逐个的调用动画

    widget.setup(w => {
         yield 3 // 等待 3 秒
         console.log('Hello world!')
         // 执行动画
         yield create().withAttr({ duration: 3 })
    })
    

    事件系统

    Newcar 相比于 Manim 最大的好处就是可以进行交互,这也是前端的一大优势

    交互

    新版本增加了交互系统,如 scalable, 可以让用户自由缩放组件

    new Widget({
        dragable: true,
        scalable: true,
    })
    
    [https://github.com/dromara/newcar]( https://github.com/dromara/newcar)
    1 replies    2024-07-25 15:38:32 +08:00
    asLw0P981N0M0TCC
        1
    asLw0P981N0M0TCC  
       Jul 25, 2024
    看不懂 顶
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1079 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 23:22 · PVG 07:22 · LAX 16:22 · JFK 19:22
    ♥ Do have faith in what you're doing.