⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 photopuzzlecanvas$tile.java

📁 一款拼图戏
💻 JAVA
字号:
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

class Tile extends MyBox
{
  int tileIndex;
  int myShuffledIndex;
  Image currentImage;
  Image imageTile;
  private final PhotoPuzzleCanvas this$0;

  public Tile(, int paramInt)
  {
    this.this$0 = paramPhotoPuzzleCanvas;
    this.currentImage = this.imageTile;
    this.myShuffledIndex = paramInt;
    this.tileIndex = paramInt;
    this.currentImage = Image.createImage(30, 30);
    initPhotoImage();
  }

  public void initPhotoImage()
  {
    this.left = (this.tileIndex % 4 * 30);
    this.top = (this.tileIndex / 4 * 30);
    Graphics localGraphics = this.currentImage.getGraphics();
    localGraphics.drawImage(this.this$0.topCurrentImage, -this.left, -this.top, 0x10 | 0x4);
    this.left = (this.this$0.xBoardOffset + this.left);
    this.top = (this.this$0.yBoardOffset + this.top);
    super.setWidthHeight(30, 30);
  }

  public void initTileImage()
  {
    this.left = 0;
    this.top = 0;
    super.setWidthHeight(30, 30);
    Graphics localGraphics = this.currentImage.getGraphics();
    localGraphics.drawImage(this.imageTile, this.xCenter, this.yCenter, 0x2 | 0x1);
    this.left = (this.this$0.xBoardOffset + this.tileIndex % 4 * 30);
    this.top = (this.this$0.yBoardOffset + this.tileIndex / 4 * 30);
    super.setWidthHeight(30, 30);
  }

  public void draw()
  {
    int i = this.this$0.tiles[this.myShuffledIndex].left;
    int j = this.this$0.tiles[this.myShuffledIndex].top;
    if ((this.this$0.showIntro) && (!(this.this$0.showIntroShuffle)))
    {
      i = this.this$0.tiles[this.tileIndex].left;
      j = this.this$0.tiles[this.tileIndex].top;
      paramGraphics.drawImage(this.currentImage, i, j, 0x10 | 0x4);
      return;
    }
    if (this.this$0.puzzleSolved)
    {
      paramGraphics.drawImage(this.currentImage, i, j, 0x10 | 0x4);
      return;
    }
    if (this.tileIndex == this.this$0.indexBlankTile)
    {
      paramGraphics.setColor(0, 0, 255);
      paramGraphics.fillRect(i, j, 30, 30);
    }
    else
    {
      paramGraphics.drawImage(this.currentImage, i, j, 0x10 | 0x4);
    }
    paramGraphics.setColor(0, 0, 0);
    paramGraphics.drawRect(i, j, 30, 30);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -