Game Development Reference
In-Depth Information
public void pause() {
}
@Override
public void resume() {
}
}
Gradle users should copy this code to the
MyDemo
class. We need this
code to do a simple experimentation with code hot swapping, which
is coming in the next section. Although you don't have the
libgdx.
png
file, you can use any standard paint tools to create a placeholder
image of size 512 x 512, or download the
libgdx.png
file from the
example project in the provided code bundle. Then, go to the
assets
directory in the
demo-android
project, create a
data
folder, and
save the
libgdx.png
file in it.
Having fun with the debugger and Code Hot
Swapping
In this section, we are going to use the debugger to take a look inside the
demo
project at runtime. To do this, we first set a breakpoint where the execution of the
application should be halted so that we can easily inspect the current state. Open
the
MyDemo
.java source file in Eclipse and set a breakpoint at the line where a new
instance of
SpriteBatch
is created, as shown here:
Double-click on the shaded, empty space at the very left-hand side
of the editor window in Eclipse to set or remove already existing
breakpoints, which will insert a blue dot to signify the breakpoint,
as shown in the preceding screenshot.