提交 d664dbfa 编写于 作者: C Chinmay Garde

Merge pull request #358 from chinmaygarde/master

Specify a default launch screen for iOS Asteroids
......@@ -113,7 +113,7 @@ template("sky_app") {
"$target_gen_dir/app.skyx",
]
resources += invoker.launcher_icons
resources += invoker.launcher_resources
bundle_directory = "."
deps = [ ":app" ]
......
......@@ -16,9 +16,10 @@ sky_app("game") {
]
} else if (is_ios) {
info_plist = "ios/Info.plist"
launcher_icons = [
launcher_resources = [
"assets/Icon.png",
"assets/Icon@2x.png",
"ios/LaunchScreen.storyboardc",
]
}
}
......@@ -15,6 +15,9 @@
<key>CFBundleDisplayName</key>
<string>Asteroids</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>CFBundleIdentifier</key>
<string>org.domokit.sky.game</string>
......
......@@ -58,6 +58,7 @@ static sky::InputEventPtr BasicInputEventFromRecognizer(
@implementation SkySurface {
BOOL _platformViewInitialized;
CGPoint _lastScrollTranslation;
sky::SkyEnginePtr _sky_engine;
scoped_ptr<sky::shell::ShellView> _shell_view;
......@@ -274,6 +275,7 @@ static sky::InputEventPtr BasicInputEventFromRecognizer(
sky::EventType type = sky::EVENT_TYPE_UNKNOWN;
switch (recognizer.state) {
case UIGestureRecognizerStateBegan:
_lastScrollTranslation = CGPointZero;
type = sky::EVENT_TYPE_GESTURE_SCROLL_BEGIN;
break;
case UIGestureRecognizerStateChanged:
......@@ -297,8 +299,11 @@ static sky::InputEventPtr BasicInputEventFromRecognizer(
auto translation = [recognizer translationInView: self];
auto velocity = [recognizer velocityInView: self];
input->gesture_data->dx = translation.x * scale;
input->gesture_data->dy = translation.y * scale;
input->gesture_data->dx = (translation.x - _lastScrollTranslation.x) * scale;
input->gesture_data->dy = (translation.y - _lastScrollTranslation.y) * scale;
_lastScrollTranslation = translation;
input->gesture_data->velocityX = velocity.x * scale;
input->gesture_data->velocityY = velocity.y * scale;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册