Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator を省略する記述の作成 #103

Open
rrbox opened this issue Mar 16, 2023 · 2 comments
Open

Generator を省略する記述の作成 #103

rrbox opened this issue Mar 16, 2023 · 2 comments
Labels
type: Enhancement New feature or request

Comments

@rrbox
Copy link
Owner

rrbox commented Mar 16, 2023

default というコンピューテッドプロパティを提案します。これは setGeneratorsetProcessor を省略するメソッドになります。SKNode.init() の generator がセットされた状態になります。

@rrbox
Copy link
Owner Author

rrbox commented Mar 16, 2023

Processor のセット方法をどうするべきか。

@rrbox rrbox added the type: Enhancement New feature or request label Apr 14, 2023
@rrbox
Copy link
Owner Author

rrbox commented Dec 29, 2023

こんな processor の設定方法も考えたいです.

Builder<SKLabelNode>()
    .setGenerator(.default)
    .setProcessor { processor in
        processor
            .text("sample")
            .position(CGPoint(x: 100, y: 50))
            .alpha(0.5)
    }
    .node()

こんな関数かな?

public extension Builder where T == Blank<Generator.Node> {
    func setProcessor<Result: ProcessorProtocol>(_ create: (Processor<Generator.Node>) -> Result) -> Builder<Generator, Result> {
        let result = create(Processor<Generator.Node>())
        .init(self.generator, processor: result)
    }
    
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant