mirror of
https://github.com/tiennm99/libGDX-tutorial.git
synced 2026-08-06 02:23:24 +00:00
[Init] v1
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
gwt {
|
||||
gwtVersion = '2.8.2' // Should match the gwt version used for building the gwt backend
|
||||
maxHeapSize = "1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY
|
||||
minHeapSize = "1G"
|
||||
|
||||
src = files(file("src/")) // Needs to be in front of "modules" below.
|
||||
modules 'com.badlogic.drop.GdxDefinition'
|
||||
devModules 'com.badlogic.drop.GdxDefinitionSuperdev'
|
||||
project.webAppDirName = 'webapp'
|
||||
|
||||
compiler {
|
||||
strict = true;
|
||||
disableCastChecking = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
import org.akhikhl.gretty.AppBeforeIntegrationTestTask
|
||||
import org.wisepersist.gradle.plugins.gwt.GwtSuperDev
|
||||
|
||||
gretty.httpPort = 8080
|
||||
gretty.resourceBase = project.buildDir.path + "/gwt/draftOut"
|
||||
gretty.contextPath = "/"
|
||||
gretty.portPropertiesFileName = "TEMP_PORTS.properties"
|
||||
|
||||
task startHttpServer() {
|
||||
dependsOn draftCompileGwt
|
||||
|
||||
doFirst {
|
||||
copy {
|
||||
from "webapp"
|
||||
into gretty.resourceBase
|
||||
}
|
||||
|
||||
copy {
|
||||
from "war"
|
||||
into gretty.resourceBase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task beforeRun(type: AppBeforeIntegrationTestTask, dependsOn: startHttpServer) {
|
||||
// The next line allows ports to be reused instead of
|
||||
// needing a process to be manually terminated.
|
||||
file("build/TEMP_PORTS.properties").delete()
|
||||
// Somewhat of a hack; uses Gretty's support for wrapping a task in
|
||||
// a start and then stop of a Jetty server that serves files while
|
||||
// also running the SuperDev code server.
|
||||
integrationTestTask 'superDev'
|
||||
|
||||
interactive false
|
||||
}
|
||||
|
||||
task superDev(type: GwtSuperDev) {
|
||||
dependsOn startHttpServer
|
||||
doFirst {
|
||||
gwt.modules = gwt.devModules
|
||||
}
|
||||
}
|
||||
|
||||
task dist(dependsOn: [clean, compileGwt]) {
|
||||
doLast {
|
||||
file("build/dist").mkdirs()
|
||||
copy {
|
||||
from "build/gwt/out"
|
||||
into "build/dist"
|
||||
}
|
||||
copy {
|
||||
from "webapp"
|
||||
into "build/dist"
|
||||
}
|
||||
copy {
|
||||
from "war"
|
||||
into "build/dist"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task addSource {
|
||||
doLast {
|
||||
sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.compileGwt.dependsOn(addSource)
|
||||
tasks.draftCompileGwt.dependsOn(addSource)
|
||||
|
||||
sourceCompatibility = 1.7
|
||||
sourceSets.main.java.srcDirs = ["src/"]
|
||||
|
||||
eclipse.project.name = appName + "-html"
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN"
|
||||
"http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd">
|
||||
<module rename-to="html">
|
||||
<collapse-property name="user.agent" values="*"/>
|
||||
<entry-point class='com.badlogic.drop.client.HtmlLauncher'/>
|
||||
|
||||
<inherits name='Drop'/>
|
||||
<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt'/>
|
||||
<inherits name='com.badlogic.gdx.physics.box2d.box2d-gwt'/>
|
||||
<set-configuration-property name="gdx.assetpath" value="../android/assets"/>
|
||||
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
|
||||
<set-property name="user.agent" value="gecko1_8, safari"/>
|
||||
</module>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN"
|
||||
"http://www.gwtproject.org/doctype/2.8.0/gwt-module.dtd">
|
||||
<module rename-to="html">
|
||||
<add-linker name="xsiframe"/>
|
||||
<collapse-all-properties/>
|
||||
|
||||
<inherits name='com.badlogic.drop.GdxDefinition'/>
|
||||
|
||||
<inherits name='com.badlogic.gdx.backends.gdx_backends_gwt'/>
|
||||
|
||||
<inherits name='com.badlogic.gdx.physics.box2d.box2d-gwt'/>
|
||||
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
|
||||
<set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
|
||||
</module>
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.badlogic.drop.client;
|
||||
|
||||
import com.badlogic.drop.Drop;
|
||||
import com.badlogic.gdx.ApplicationListener;
|
||||
import com.badlogic.gdx.backends.gwt.GwtApplication;
|
||||
import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
|
||||
|
||||
public class HtmlLauncher extends GwtApplication {
|
||||
|
||||
@Override
|
||||
public GwtApplicationConfiguration getConfig() {
|
||||
// Resizable application, uses available space in browser
|
||||
// return new GwtApplicationConfiguration(true);
|
||||
// Fixed size application:
|
||||
return new GwtApplicationConfiguration(800, 480);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationListener createApplicationListener() {
|
||||
return new Drop();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" ?>
|
||||
<web-app>
|
||||
</web-app>
|
||||
@@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>drop</title>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<meta content="width=device-width initial-scale=1" id="gameViewport" name="viewport">
|
||||
<link href="styles.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a class="superdev"
|
||||
href="javascript:%7B%20window.__gwt_bookmarklet_params%20%3D%20%7B'server_url'%3A'http%3A%2F%2Flocalhost%3A9876%2F'%7D%3B%20var%20s%20%3D%20document.createElement('script')%3B%20s.src%20%3D%20'http%3A%2F%2Flocalhost%3A9876%2Fdev_mode_on.js'%3B%20void(document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D">↻</a>
|
||||
<div align="center" id="embed-html"></div>
|
||||
<script src="html/html.nocache.js" type="text/javascript"></script>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
function handleMouseDown(evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
window.focus();
|
||||
}
|
||||
|
||||
function handleMouseUp(evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
|
||||
document.getElementById('embed-html').addEventListener('mousedown', handleMouseDown, false);
|
||||
document.getElementById('embed-html').addEventListener('mouseup', handleMouseUp, false);
|
||||
</script>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,43 @@
|
||||
canvas {
|
||||
cursor: default;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #222222;
|
||||
}
|
||||
|
||||
.superdev {
|
||||
color: rgb(37, 37, 37);
|
||||
text-shadow: 0px 1px 1px rgba(250, 250, 250, 0.1);
|
||||
font-size: 50pt;
|
||||
display: block;
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
background-color: rgb(83, 87, 93);
|
||||
box-shadow: 0px 3px 0px 0px rgb(34, 34, 34),
|
||||
0px 7px 10px 0px rgb(17, 17, 17),
|
||||
inset 0px 1px 1px 0px rgba(250, 250, 250, .2),
|
||||
inset 0px -12px 35px 0px rgba(0, 0, 0, .5);
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
border: 0;
|
||||
border-radius: 35px;
|
||||
text-align: center;
|
||||
line-height: 68px;
|
||||
}
|
||||
|
||||
.superdev:active {
|
||||
box-shadow: 0px 0px 0px 0px rgb(34, 34, 34),
|
||||
0px 3px 7px 0px rgb(17, 17, 17),
|
||||
inset 0px 1px 1px 0px rgba(250, 250, 250, .2),
|
||||
inset 0px -10px 35px 5px rgba(0, 0, 0, .5);
|
||||
background-color: rgb(83, 87, 93);
|
||||
top: 3px;
|
||||
color: #fff;
|
||||
text-shadow: 0px 0px 3px rgb(250, 250, 250);
|
||||
}
|
||||
|
||||
.superdev:hover {
|
||||
background-color: rgb(100, 100, 100);
|
||||
}
|
||||
Reference in New Issue
Block a user