Game Development Reference
In-Depth Information
First, add these new constants to the Constants class that point to the files of our
new shader program:
// Shader
public static final String shaderMonochromeVertex =
"shaders/monochrome.vs";
public static final String shaderMonochromeFragment =
"shaders/monochrome.fs";
After this, add the following line to the GamePreferences class:
public boolean useMonochromeShader;
Next, make the following changes to the same class:
public void load () {
showFpsCounter = prefs.getBoolean("showFpsCounter", false);
useMonochromeShader = prefs.getBoolean("useMonochromeShader",
false);
}
public void save () {
prefs.putBoolean("showFpsCounter", showFpsCounter);
prefs.putBoolean("useMonochromeShader", useMonochromeShader);
prefs.flush();
}
Then, add the following line to the MenuScreen class:
private CheckBox chkUseMonoChromeShader;
After this, make the following changes to the same class:
private Table buildOptWinDebug () {
Table tbl = new Table();
// + Title: "Debug"
// + Checkbox, "Show FPS Counter" label
// + Checkbox, "Use Monochrome Shader" label
chkUseMonochromeShader = new CheckBox("", skinLibgdx);
tbl.add(new Label("Use Monochrome Shader", skinLibgdx));
tbl.add(chkUseMonochromeShader);
tbl.row();
return tbl;
}
private void loadSettings () {
 
Search WWH ::




Custom Search