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

Allow default action for touch events #184

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions command/data/embedder/flambe.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
*/
var flambe = {};

/** @define {string} */
flambe.FLASH_VERSION = "11";

/**
* Embed a Flambe game into the page.
*
Expand Down Expand Up @@ -45,8 +42,12 @@ flambe.embed = function (urls, elementId) {

switch (ext) {
case "swf":
var flashVersion = "11.2";

if ((pref == null || pref == "flash")
&& swfobject.hasFlashPlayerVersion(flambe.FLASH_VERSION)) {
&& swfobject.hasFlashPlayerVersion(flashVersion)
// Android Flash is old and busted
&& !/\bAndroid\b/.exec(navigator.userAgent)) {

// SWFObject replaces the element it's given, so create a temporary inner element
// for parity with JS
Expand All @@ -64,10 +65,9 @@ flambe.embed = function (urls, elementId) {
};
}

swfobject.embedSWF(url, swf.id, "100%", "100%", flambe.FLASH_VERSION, null, {}, {
swfobject.embedSWF(url, swf.id, "100%", "100%", flashVersion, null, {}, {
allowScriptAccess: "always",
allowFullScreen: "true",
fullscreenOnSelection: "true",
wmode: "direct"
}, {id: swf.id, name: swf.id});
return true;
Expand Down
20 changes: 20 additions & 0 deletions command/data/firefox/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<style>
html, body, #content {
width: 100%;
height: 100%;
margin: 0;
background: black;
}
</style>
</head>
<body>
<div id="content">
<script src="targets/main-firefox.js"></script>
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions command/data/scaffold/Project.hxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
<hidden path="build" />
</hiddenPaths>
<!-- Executed before build -->
<preBuildCommand>cmd /c flambe build --$(BuildConfig)</preBuildCommand>
<preBuildCommand>cmd /c flambe build $(TargetBuild) --$(BuildConfig)</preBuildCommand>
<!-- Executed after build -->
<postBuildCommand alwaysRun="False" />
<!-- Other project options -->
<options>
<option showHiddenPaths="False" />
<option testMovie="Custom" />
<option testMovieCommand="flambe run --$(BuildConfig) --no-build --no-fdb || pause" />
<option testMovieCommand="flambe run $(TargetBuild) --$(BuildConfig) --no-build --no-fdb || pause" />
</options>
<!-- Plugin storage -->
<storage />
Expand Down
48 changes: 36 additions & 12 deletions command/data/scaffold/flambe.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
# The name, version and identifier, for mobile app packaging
# Basic information about the game.
name: Your Game
description: A short one-line description.

# Information about the game developer.
developer:
name: Your Company Name
url: http://yourwebsite.com

# The game's unique identifier.
id: com.yourdomain.yourgame

# The game's version string.
version: 1.0.0
id: com.urdomain.urgame

# The main class name
# The main class name.
main: urgame.Main

# The platform to use when invoking `run` or `build` with no arguments
# The platform to use when invoking `run` or `build` with no arguments.
default_platform: flash

# Additional flags to pass to the Haxe compiler
# The initial orientation and fullscreen state on mobile devices.
orientation: portrait
fullscreen: true

# Additional flags to pass to the Haxe compiler.
# haxe_flags: -lib nape -D foobar

# Additional paths to include in the build
# Additional paths to include in the build.
# extra_paths:
# assets: dir1 dir2
# libs: dir1 dir2
# src: ../dir1 ../dir2
# web: ["dir1 with spaces", "dir2"]

# The initial orientation and fullscreen state
orientation: portrait
fullscreen: true

# Android-specific configuration
# Android-specific configuration.
android:
# https://developer.android.com/guide/topics/manifest/manifest-intro.html
AndroidManifest.xml: |
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
# The signing password for certs/android.p12
password: password

# iOS-specific configuration
# iOS-specific configuration.
ios:
# http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference
Info.plist: |
Expand All @@ -42,3 +54,15 @@ ios:
</array>
<key>UIPrerenderedIcon</key>
<true/>
# The signing password for certs/ios-development.p12
password: password

# Firefox App-specific configuration.
firefox:
# https://developer.mozilla.org/en-US/docs/Web/Apps/Manifest
manifest.webapp:
{
default_locale: "en",
# type: "privileged",
# permissions: [...]
}
Binary file added command/data/scaffold/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion command/data/scaffold/src/urgame/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Main
System.init();

// Load up the compiled pack in the assets directory named "bootstrap"
var manifest = Manifest.build("bootstrap");
var manifest = Manifest.fromAssets("bootstrap");
var loader = System.loadAssetPack(manifest);
loader.get(onSuccess);
}
Expand Down
2 changes: 1 addition & 1 deletion command/data/scaffold/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>Your Game</title>

<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
Expand Down
28 changes: 26 additions & 2 deletions command/flambe.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ cmd.setDefaults({action: function (args) {
var addCommonArguments = function (parser) {
parser.addArgument(["--debug"], {action: "storeTrue", help: "Build in debug mode."});
parser.addArgument(["--fdb-host"], {help: "The address AIR apps should connect to for debugging."});
parser.addArgument(["--haxe-server"], {help: "Connect to a Haxe compiler server at this address/port."});

// For FlashDevelop, does absolutely nothing
parser.addArgument(["--release"], {action: "storeTrue", help: argparse.Const.SUPPRESS});
Expand All @@ -76,7 +77,13 @@ cmd.setDefaults({action: function (args) {
catchErrors(
flambe.loadConfig(args.config)
.then(function (config) {
return flambe.run(config, args.platform, {debug: args.debug, noBuild: args.no_build, fdbHost: args.fdb_host, noFdb: args.no_fdb});
return flambe.run(config, args.platform, {
debug: args.debug,
fdbHost: args.fdb_host,
haxeServer: args.haxe_server,
noBuild: args.no_build,
noFdb: args.no_fdb,
});
}));
}});

Expand All @@ -89,7 +96,11 @@ cmd.setDefaults({action: function (args) {
catchErrors(
flambe.loadConfig(args.config)
.then(function (config) {
return flambe.build(config, args.platforms, {debug: args.debug, fdbHost: args.fdb_host});
return flambe.build(config, args.platforms, {
debug: args.debug,
fdbHost: args.fdb_host,
haxeServer: args.haxe_server,
});
}));
}});

Expand All @@ -115,6 +126,19 @@ cmd.setDefaults({action: function () {
}));
}});

var cmd = commands.addParser("haxe-flags", {help: "Show Haxe compiler completion flags.",
description: "For IDE implementors, prints flags that can be passed to the Haxe compiler for code completion."
});
cmd.addArgument(["platform"], {metavar: "platform", nargs: "?",
help: "A platform to target. Choose from " + flambe.PLATFORMS.join(", ") + ". If omitted, 'default_platform' from flambe.yaml will be used."});
cmd.setDefaults({action: function () {
catchErrors(
flambe.loadConfig(args.config)
.then(function (config) {
console.log(flambe.getHaxeFlags(config, args.platform).join("\n"));
}));
}});

var cmd = commands.addParser("update", {help: "Update to the latest Flambe version.",
description: "Upgrade to the latest version of Flambe, or downgrade to an earlier version. This command should be run as root/Administrator.",
aliases: ["upgrade"]});
Expand Down
Loading