changing to screenW/H and documenting it

This commit is contained in:
benfry
2010-03-04 13:56:31 +00:00
parent 772ec61e1e
commit e89be2a053
3 changed files with 13 additions and 10 deletions
+3 -1
View File
@@ -103,7 +103,9 @@
+ Cannot use .gz files in the data or assets folder, because Android wants
to compress the files itself.
+ Use screenWidth and screenHeight instead of screen.width and screen.height.
+ Use screenW and screenH instead of screen.width and screen.height. Both
variables have been added to the desktop version of processing.core,
where the 'screen' variable has been deprecated.
+ To use the virtual keyboard, hold down the MENU key on the device. This
is an Android default, but some users might not be familiar with it.
@@ -74,9 +74,9 @@ public class PApplet extends Activity implements PConstants, Runnable {
* This variable is not static, because future releases need to be better
* at handling multiple displays.
*/
static public int screenW, screenH;
// public Dimension screen =
// Toolkit.getDefaultToolkit().getScreenSize();
public int screenWidth, screenHeight;
/**
* Command line options passed in from main().
@@ -409,8 +409,8 @@ public class PApplet extends Activity implements PConstants, Runnable {
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
screenWidth = dm.widthPixels;
screenHeight = dm.heightPixels;
screenW = dm.widthPixels;
screenH = dm.heightPixels;
//println("screen size is " + screenWidth + "x" + screenHeight);
if (sketchRenderer().equals(A2D)) {
@@ -419,8 +419,8 @@ public class PApplet extends Activity implements PConstants, Runnable {
surfaceView = new SketchSurfaceView3D(this);
}
width = screenWidth;
height = screenHeight;
width = screenW;
height = screenH;
window.setContentView(surfaceView); // set full screen
@@ -528,7 +528,7 @@ public class PApplet extends Activity implements PConstants, Runnable {
// before surfaceChanged() is ever called.
PGraphics newGraphics = new PGraphicsAndroid3D();
// Set semi-arbitrary size; will be set properly when surfaceChanged() called
newGraphics.setSize(screenWidth, screenHeight);
newGraphics.setSize(screenW, screenH);
newGraphics.setParent(PApplet.this);
newGraphics.setPrimary(true);
g = newGraphics;
@@ -629,7 +629,7 @@ public class PApplet extends Activity implements PConstants, Runnable {
// println("creating graphics");
PGraphics newGraphics = new PGraphicsAndroid2D();
// Set semi-arbitrary size; will be set properly when surfaceChanged() called
newGraphics.setSize(screenWidth, screenHeight);
newGraphics.setSize(screenW, screenH);
// newGraphics.setSize(getWidth(), getHeight());
newGraphics.setParent(PApplet.this);
newGraphics.setPrimary(true);
@@ -738,12 +738,12 @@ public class PApplet extends Activity implements PConstants, Runnable {
public int sketchWidth() {
return screenWidth;
return screenW;
}
public int sketchHeight() {
return screenHeight;
return screenH;
}
+1
View File
@@ -20,6 +20,7 @@ X drastically improve the performance of the time functions
X point wasn't detecting different stroke weights
X point wasn't working with strokeWeight > 1
X fix rotate() bug (was using degrees instead of radians)
X http://dev.processing.org/bugs/show_bug.cgi?id=1497
X arc() now working properly
X createGraphics() works, at least with A2D (or aliases P2D and JAVA2D)
X "The application ... has stopped unexpectedly." when quitting a slow app