目录
目录README.md

SwiftyCreatives

Release Swift Compatibility Platform Compatibility License

Creative coding framework for Swift.
Using Metal directly for rendering.

ExampleMacOSApp 2022年-12月-16日 18 08 41

Features

Geometry Other Features
Rectangle (with hit test) Perspective Camera
Circle Orthographic Camera
Triangle BlendMode(normal, add, alphaBlend)
Line Lighting
Box (with hit test) push/pop matrix
3D Model can be used as UIView / NSView
Image (with hit test) can be used as SwiftUI View
Text Post Processing
UIViewObject (3d view with interactive button) User-defined shaders

ExampleMacOSApp 2023年-02月-24日 17 11 06

CheckMacOS 2023年-03月-01日 6 46 57

QuickTime Player - 画面収録 2023-02-10 1 53 14 mov 2023年-02月-10日 2 55 14

Sample Code

Main sketch process

import SwiftyCreatives

final class SampleSketch: Sketch {
    override func draw(encoder: SCEncoder) {
        let count = 20
        for i in 0...count {
            color(1, Float(i) / 20, 0, 1)
            pushMatrix()
            rotateY(Float.pi * 2 / Float(count) * Float(i))
            translate(10, 0, 0)
            box(1, 1, 1)
            popMatrix()
        }
    }
}

You can use SketchView as SwiftUI View

ZStack {
    SketchView(SampleSketch())
}
.background(.black)
スクリーンショット 2023-02-03 7 51 34

Other Examples

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号