HTML5版(Canvas)のLWFで、あるフレームを実行するとrootMovieがdestroyされる。 そのフレーム以降のアニメーションも同様。 iOS6のUIWebView, Chromeで確認。その他は未確認。
以下を使ってmainを回してexec & renderしている。 https://github.com/yonekawa/lwf.enchant.js/blob/master/lwf.enchant.coffee
window.onload = function() { | |
enchant(); | |
var game = new Game(640, 960); | |
game.fps = 60; | |
game.preload('bg.jpg'); | |
game.preload('chara1.png'); | |
game.onload = function () { | |
var bg = new Sprite(640, 960); | |
bg.image = game.assets['bg.jpg']; |
diff --git a/enchant.js b/enchant.js | |
index bf83ff1..0d0ed17 100644 | |
--- a/enchant.js | |
+++ b/enchant.js | |
@@ -1809,7 +1809,8 @@ enchant.Sprite = enchant.Class.create(enchant.Entity, { | |
if (this._dirty) { | |
this._style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = [ | |
'rotate(', this._rotation, 'deg)', | |
- 'scale(', this._scaleX, ',', this._scaleY, ')' | |
+ 'scale(', this._scaleX, ',', this._scaleY, ')', |
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m | |
index a0a29f0..520050d 100644 | |
--- a/CordovaLib/Classes/CDVViewController.m | |
+++ b/CordovaLib/Classes/CDVViewController.m | |
@@ -510,7 +510,7 @@ | |
// The iOSVCAddr is used to identify the WebView instance when using one of the XHR js->native bridge modes. | |
// The .onNativeReady().fire() will work when cordova.js is already loaded. | |
// The _nativeReady = true; is used when this is run before cordova.js is loaded. | |
- NSString* nativeReady = [NSString stringWithFormat:@"cordova.iOSVCAddr='%lld';try{cordova.require('cordova/channel').onNativeReady.fire();}catch(e){window._nativeReady = true;}", (long long)self]; | |
+ NSString* nativeReady = [NSString stringWithFormat:@"window.iOSVCAddr='%lld';try{cordova.require('cordova/channel').onNativeReady.fire();}catch(e){window._nativeReady = true;}", (long long)self]; |
enchant(); | |
var NewScene = enchant.Class.create(enchant.Scene, { | |
initialize: function() { | |
enchant.Scene.call(this); | |
for (var i = 0; i < 100; i++) { | |
var sprite = new Sprite(32, 32); | |
sprite.image = enchant.Game.instance.assets['chara1.png']; | |
this.addChild(sprite); | |
} |
diff --git a/cordova/ios/CordovaLib/Classes/CDVCommandDelegate.h b/cordova/ios/CordovaLib/Classes/CDVCommandDelegate.h | |
--- a/cordova/ios/CordovaLib/Classes/CDVCommandDelegate.h | |
+++ b/cordova/ios/CordovaLib/Classes/CDVCommandDelegate.h | |
@@ -42,6 +42,8 @@ | |
// without reason. Without the run-loop delay, alerts used in JS callbacks may result | |
// in dead-lock. This method must be called from the UI thread. | |
- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop; | |
+// Patch for using RequireJS. | |
+- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop useNativeEvalAndFetch:(BOOL)useNativeEvalAndFetch; | |
// Runs the given block on a background thread using a shared thread-pool. |
HTML5版(Canvas)のLWFで、あるフレームを実行するとrootMovieがdestroyされる。 そのフレーム以降のアニメーションも同様。 iOS6のUIWebView, Chromeで確認。その他は未確認。
以下を使ってmainを回してexec & renderしている。 https://github.com/yonekawa/lwf.enchant.js/blob/master/lwf.enchant.coffee
<?xml version='1.0'?> | |
<signatures version='1.0'> | |
<enum name='kDynamicBodyType' value='2'/> | |
<enum name='kKinematicBodyType' value='1'/> | |
<enum name='kStaticBodyType' value='0'/> | |
<class name='B2DBody'> | |
<method selector='addFixureForShape:friction:restitution:density:isSensor:'> | |
<arg name='shape' index='0' declared_type='B2DShape*' type='@'/> | |
<arg name='friction' index='1' declared_type='id' type='@'/> | |
<arg name='restitution' index='2' declared_type='id' type='@'/> |
diff --git a/facebook/src/com/facebook/internal/AttributionIdentifiers.java b/facebook/src/com/facebook/internal/AttributionIdentifiers.java | |
index 1c8f630..f142f25 100644 | |
--- a/facebook/src/com/facebook/internal/AttributionIdentifiers.java | |
+++ b/facebook/src/com/facebook/internal/AttributionIdentifiers.java | |
@@ -104,25 +104,23 @@ public class AttributionIdentifiers { | |
try { | |
String [] projection = {ATTRIBUTION_ID_COLUMN_NAME, ANDROID_ID_COLUMN_NAME, LIMIT_TRACKING_COLUMN_NAME}; | |
Cursor c = context.getContentResolver().query(ATTRIBUTION_ID_CONTENT_URI, projection, null, null, null); | |
- if (c == null || !c.moveToFirst()) { | |
- return null; |
import SwiftFlux | |
struct CounterActions { | |
struct Plus: Action { | |
typealias Payload = Int | |
let number: Int | |
func invoke(dispatcher: Dispatcher) { | |
dispatcher.dispatch(self, result: Result(value: number)) | |
} |
import APIKit | |
import SwiftFlux | |
struct TodoActions { | |
struct Fetch { | |
typealias Payload = Todo | |
func invoke(dispatcher: Dispatcher) { | |
Session.sendRequest(TodoFetch(id: 1)) { (result) in | |
switch response { | |
case .Success(let todo): |