BNBEffect
Objective-C
@interface BNBEffect : NSObject
/** Thread-safe. May be called from any thread */
- (nonnull NSString *)url;
- (nonnull NSString *)name;
/**
 * Call js method in effect. 
 * @param methodName JS global function name. Member functions are not supported.
 * @param params Function arguments.
 * @depreacted Use `evalJs` instead.
 */
- (void)callJsMethod:(nonnull NSString *)methodName
              params:(nonnull NSString *)params;
/**
 * Evaluate the `script` in effect. This method is thread safe.
 * @param sctipt JS string to execute 
 * @param js_callback Callback for result, will be called in render thread.
 */
- (void)evalJs:(nonnull NSString *)script
resultCallback:(nullable id<BNBJsCallback>)resultCallback;
/**
 * Evaluate the `script` in effect.
 * MUST be called from the render thread
 * @param sctipt JS string to execute 
 * @return JS evaluation result
 */
- (nonnull NSString *)evalJsSync:(nonnull NSString *)script;
/**
 * Reset effect state
 * MUST be called from the render thread
 */
- (void)reset;
/**
 * Update effect state (evaluate scheduled JS calls)
 * MUST be called from the render thread
 */
- (void)update;
/**
 * Deserialize effect from the provided `resoved_url`. If `configOverride` is an
 * empty string, will use `config.json` under provided `resolvedUrl`, otherwise
 * content of `configOverride` will be used.
 * 
 * Can be called from any thread.
 */
- (void)deserialize:(nonnull NSString *)resolvedUrl
     configOverride:(nonnull NSString *)configOverride;
/**
 * activate current effect
 * MUST be called from the render thread for OpenGL backends.
 */
- (void)activate:(int32_t)fxWidth
        fxHeight:(int32_t)fxHeight
    surfaceWidth:(int32_t)surfaceWidth
   surfaceHeight:(int32_t)surfaceHeight;
- (BNBEffectStatus)status;
- (int64_t)getNativeContext;
@end
                Swift
class BNBEffect : NSObject
                Undocumented
- 
                  
                  
Thread-safe. May be called from any thread
Declaration
Objective-C
- (nonnull NSString *)url;Swift
func url() -> String - 
                  
                  
Undocumented
Declaration
Objective-C
- (nonnull NSString *)name;Swift
func name() -> String - 
                  
                  
Call js method in effect.
Declaration
Objective-C
- (void)callJsMethod:(nonnull NSString *)methodName params:(nonnull NSString *)params;Swift
func callJsMethod(_ methodName: String, params: String)Parameters
methodNameJS global function name. Member functions are not supported.
paramsFunction arguments. @depreacted Use
evalJsinstead. - 
                  
                  
Evaluate the
scriptin effect. This method is thread safe.Declaration
Objective-C
- (void)evalJs:(nonnull NSString *)script resultCallback:(nullable id<BNBJsCallback>)resultCallback;Swift
func evalJs(_ script: String, resultCallback: (any BNBJsCallback)?)Parameters
sctiptJS string to execute
js_callbackCallback for result, will be called in render thread.
 - 
                  
                  
Evaluate the
scriptin effect. MUST be called from the render threadDeclaration
Objective-C
- (nonnull NSString *)evalJsSync:(nonnull NSString *)script;Swift
func evalJsSync(_ script: String) -> StringParameters
sctiptJS string to execute
Return Value
JS evaluation result
 - 
                  
                  
Reset effect state MUST be called from the render thread
Declaration
Objective-C
- (void)reset;Swift
func reset() - 
                  
                  
Update effect state (evaluate scheduled JS calls) MUST be called from the render thread
Declaration
Objective-C
- (void)update;Swift
func update() - 
                  
                  
Deserialize effect from the provided
resoved_url. IfconfigOverrideis an empty string, will useconfig.jsonunder providedresolvedUrl, otherwise content ofconfigOverridewill be used.Can be called from any thread.
Declaration
Objective-C
- (void)deserialize:(nonnull NSString *)resolvedUrl configOverride:(nonnull NSString *)configOverride;Swift
func deserialize(_ resolvedUrl: String, configOverride: String) - 
                  
                  
activate current effect MUST be called from the render thread for OpenGL backends.
Declaration
Objective-C
- (void)activate:(int32_t)fxWidth fxHeight:(int32_t)fxHeight surfaceWidth:(int32_t)surfaceWidth surfaceHeight:(int32_t)surfaceHeight;Swift
func activate(_ fxWidth: Int32, fxHeight: Int32, surfaceWidth: Int32, surfaceHeight: Int32) - 
                  
                  
Undocumented
 - 
                  
                  
Undocumented
Declaration
Objective-C
- (int64_t)getNativeContext;Swift
func getNativeContext() -> Int64 
        BNBEffect Class Reference