add some api for doric context

This commit is contained in:
pengfei.zhou
2019-08-13 18:13:54 +08:00
parent 1ddbfcf8e4
commit ba2a90a6c1
6 changed files with 60 additions and 3 deletions

View File

@@ -26,8 +26,7 @@ - (void)viewDidLoad {
NSString *jsContent = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
self.doricContext = [[DoricContext alloc] initWithScript:jsContent source:@"Snake"];
self.doricContext.rootNode.view = self.view;
[self.doricContext callEntity:@"__init__",@{@"width": [NSNumber numberWithFloat:self.view.width],
@"height":[NSNumber numberWithFloat:self.view.height]},nil];
[self.doricContext initContextWithWidth:self.view.width height:self.view.height];
}