コード例 #1
0
 /**
  * Sets the background image of the current view. The image will not be scaled to fit the screen.
  * The viewport will scroll over the backgroundimage, just like it does over the rest of the game.
  * <br>
  * Images must be stored in the res/drawable folders of your Android project. If you have only one
  * image, store it in the 'nodpi' folder. If you have various versions (hi-res and lo-res) for
  * rendering on devices of varying screen sizes, use the lo- & hi-dpi folders.
  *
  * @param backgroundImage The name of the background image that will be set
  */
 public final void setBackground(String backgroundImage) {
   gameView.setBackgroundImage(backgroundImage);
   gameView.setBackgroundFit(false);
 }
コード例 #2
0
 /** Clears the background Image so only the background color will show */
 public final void clearBackgroundImage() {
   gameView.setBackgroundImage(null);
 }
コード例 #3
0
 /**
  * Sets the background image of the current view. You can indicate if the image must be scaled to
  * fit the screen.<br>
  * Images must be stored in the res/drawable folders of your Android project. If you have only one
  * image, store it in the 'nodpi' folder. If you have various versions (hi-res and lo-res) for
  * rendering on devices of varying screen sizes, use the lo- & hi-dpi folders.
  *
  * @param backgroundImage The name of the background image that will be set.
  * @param backgroundFit boolean, indicating if the image must be scaled to fit.
  */
 public final void setBackground(String backgroundImage, boolean backgroundFit) {
   gameView.setBackgroundImage(backgroundImage);
   gameView.setBackgroundFit(backgroundFit);
 }