Beispiel #1
0
	public final void DrawMouseOver(SpriteBatch batch) {
		this.pathVisibleTime = 0.8f;
		batch.draw(this.gameContent.mouseOver,
				this.position.sub(this.gameContent.mouseOverOrigin),
				LColor.gold);
		batch.flush();
	}
Beispiel #2
0
	@Override
	public void draw(SpriteBatch batch, GameTime gameTime) {
		batch.draw(this.texture, this.drawPosition, LColor.white);
		if (this.getNumRemainingLives() >= 0) {
			batch.drawString(this.font, "" + this.getNumRemainingLives(),
					this.drawPosition.x + 15f, this.drawPosition.y + 3f,
					LColor.white);
		}
		super.draw(batch, gameTime);
	}
Beispiel #3
0
 @Override
 public void createUI(GLEx g, int x, int y, LComponent component, LTexture[] buttonImage) {
   LFont font = g.getFont();
   int color = g.getColorARGB();
   if (batch != null) {
     batch.begin();
     draw(batch, mainX + x, mainY + y);
     batch.end();
   }
   g.setColor(color);
   g.setFont(font);
 }
Beispiel #4
0
  public void draw(SpriteBatch batch, int x, int y) {
    int windowX = x + getWidth();
    int windowY = y + getHeight();
    int tempX;
    int tempY;

    int minCol = -(x / blockSize);
    int maxCol = (minCol + ((windowX + (blockSize * 2)) / blockSize));
    if (minCol < 0) {
      minCol = 0;
    }
    if (maxCol < 0) {
      maxCol = 0;
    }
    if (maxCol > fied2d.getHeight()) {
      maxCol = fied2d.getHeight();
    }
    if (minCol > maxCol) {
      minCol = maxCol;
    }

    int minRow = -(y / blockSize);
    int maxRow = (minRow + ((windowY + (blockSize * 2)) / blockSize));
    if (minRow < 0) {
      minRow = 0;
    }
    if (maxRow < 0) {
      maxRow = 0;
    }
    if (maxRow > fied2d.getWidth()) {
      maxRow = fied2d.getWidth();
    }
    if (minRow > maxRow) {
      minRow = maxRow;
    }
    batch.draw(background, x, y, getWidth(), getHeight());
    for (int row = minRow; row < maxRow; row++) {
      for (int col = minCol; col < maxCol; col++) {
        tempX = (x + (col * blockSize));
        tempY = (y + (row * blockSize));
        int id = fied2d.getType(col, row) - 1;
        if (id != -1) {
          texture.animate(id);
          texture.update(tempX, tempY, blockSize, blockSize);
          texture.draw(batch, windowX, windowY);
        }
        if (grid) {
          batch.drawRect(tempX, tempY, blockSize, blockSize);
        }
      }
    }
  }
Beispiel #5
0
	public void Draw(SpriteBatch batch, MenuScreen screen, boolean isSelected,
			GameTime gameTime) {
		LColor black = isSelected ? LColor.white : LColor.black;
		LColor white = isSelected ? LColor.white : LColor.gray;
		isSelected = false;
		white = LColor.white;
		black = LColor.black;
		ScreenManager screenManager = screen.getScreenManager();
		this.buttonTexture = screenManager.getButtonBackground();
		if (this.getuseButtonBackground()) {
			batch.draw(this.buttonTexture, position, white);
		}
		batch.drawString(screenManager.getFont(), this.text,
				this.getTextPosition(screen), black, this.getRotation(),
				Vector2f.Zero, this.getScale());
	}
Beispiel #6
0
	public final void Draw(GameTime gameTime, SpriteBatch batch) {
		for (Bullet bullet : this.bullets) {
			bullet.Draw(batch);
		}
		if (!this.isAlive()) {
			this.removeTime = Math.max(
					(this.removeTime - gameTime.getElapsedGameTime()), 0f);
		}

		LColor colour = LColor.white;
		this.animationPlayer
				.Draw(gameTime,
						batch,
						this.position,
						colour,
						0f,
						(Math.abs(this.rotation) > 1.570796f) ? SpriteEffects.FlipHorizontally
								: SpriteEffects.None);
		batch.draw(
				this.gameContent.weapon[(int) this.rank.getValue()],
				this.position,
				null,
				colour,
				MathUtils.radToDeg(this.rotation),
				15,
				15,
				1f,
				(Math.abs(this.rotation) > 1.570796f) ? SpriteEffects.FlipVertically
						: SpriteEffects.None);
		if (this.isAlive()) {
			batch.draw(this.gameContent.healthBar, this.position.sub(
					(this.gameContent.healthBar.getWidth() / 2), 20f),
					LColor.white);
			rect.setBounds(
					0,
					0,
					(int) ((this.health / this.MaxHealth) * this.gameContent.healthBar
							.getWidth()), this.gameContent.healthBar
							.getHeight());
			batch.draw(this.gameContent.healthBar, this.position.sub(
					(this.gameContent.healthBar.getWidth() / 2), 20f), rect,
					LColor.red);
			batch.flush();
		}
	}
Beispiel #7
0
 public void dispose() {
   super.dispose();
   if (texture != null) {
     texture.dispose();
   }
   if (batch != null) {
     batch.dispose();
   }
 }
Beispiel #8
0
	@Override
	public void Draw(GameTime gameTime, SpriteBatch spriteBatch) {
		for (int i = 0; i < this.nextBalls.size(); i++) {
			this.nextBalls.get(i).Draw(gameTime, spriteBatch);
		}
		spriteBatch.draw(super.getTexture(), 0f, super.getPosition().y, 0, 0,
				480, 50, getColor(), getRotation(), 0, 0, super.getScale(),
				super.getScale(), SpriteEffects.None);
		super.Draw(gameTime, spriteBatch);
	}
Beispiel #9
0
	public final void DrawPath(GameTime gameTime, SpriteBatch batch) {
		LColor color = LColor.white;
		for (int i = 0; i < (this.destination.size() - 1); i++) {
			float rotation = MathUtils
					.atan2((this.destination.get(i + 1).y - this.destination
							.get(i).y),
							(this.destination.get(i + 1).x - this.destination
									.get(i).x));
			batch.draw(this.gameContent.pathArrow, this.destination.get(i),
					null, color, MathUtils.radToDeg(rotation), 15f, 15f, 1f,
					SpriteEffects.None);
		}
		if (this.destination.size() > 0) {
			batch.draw(this.gameContent.pathCross,
					this.destination.get(this.destination.size() - 1), null,
					color, 0f, 15f, 15f, 1f, SpriteEffects.None);
		}
		this.pathVisibleTime = MathUtils.max(
				(this.pathVisibleTime - (gameTime.getElapsedGameTime())), 0f);

	}
Beispiel #10
0
	@Override
	public void Draw(SpriteBatch batch) {
		if (isInitialised) {
			super.Draw(batch);
			if (!super.isPaused) {
				float num = 0f;
				if (this.tagSelected != null) {
					num = 0.6f;
				}
				batch.draw(super.maskTexture, 0f, 0f,
						Global.Pool.getColor(1f, 1f, 1f, num));
				if (Help.profession == Help.Profession.BattleEngineer) {
					batch.draw(t2DBattleEngineer, 60f, 90f);
				} else if (Help.profession == Help.Profession.Rifleman) {
					batch.draw(t2DRifleman, 60f, 90f, LColor.white);
				}
				Vector2f v = Screen.myFont.getOrigin("" + Help.AvailSkillPoint);
				batch.drawString(Screen.myFont, "" + Help.AvailSkillPoint,
						740f, 450f, LColor.wheat, 0f, v.x, v.y, 1f);
				v = Screen.ariel14.getOrigin("" + Help.numSkill1);
				batch.drawString(Screen.ariel14, "" + Help.numSkill1,
						this.pTagAAGun.sub(30f, 5f), LColor.wheat, 0f, v, 1f);
				v = Screen.ariel14.getOrigin("" + Help.numSkill2);
				batch.drawString(Screen.ariel14, "" + Help.numSkill2,
						this.pTagAim.sub(30f, 5f), LColor.wheat, 0f, v, 1f);
				v = Screen.ariel14.getOrigin("" + Help.numSkill3);
				batch.drawString(Screen.ariel14, "" + Help.numSkill3,
						this.pTagLearning.sub(30f, 5f), LColor.wheat, 0f, v, 1f);
				v = Screen.ariel14.getOrigin("" + Help.numSkill4);
				batch.drawString(Screen.ariel14, "" + Help.numSkill4,
						this.pTagGunner.sub(30f, 5f), LColor.wheat, 0f, v, 1f);
				if (Help.profession == Help.Profession.BattleEngineer) {
					v = Screen.ariel14.getOrigin("" + Help.numSkill5);
					batch.drawString(Screen.ariel14, "" + Help.numSkill5,
							this.pTagOverRepair.sub(30f, 5f), LColor.wheat, 0f,
							v, 1f);
					v = Screen.ariel14.getOrigin("" + Help.numSkill6);
					batch.drawString(Screen.ariel14, "" + Help.numSkill6,
							this.pTagFieldRepair.sub(30f, 5f), LColor.wheat,
							0f, v, 1f);
				} else if (Help.profession == Help.Profession.Rifleman) {
					v = Screen.ariel14.getOrigin("" + Help.numSkill7);
					batch.drawString(Screen.ariel14, "" + Help.numSkill7,
							this.pTagReloading.sub(30f, 5f), LColor.wheat, 0f,
							v, 1f);
					v = Screen.ariel14.getOrigin("" + Help.numSkill8);
					batch.drawString(Screen.ariel14, "" + Help.numSkill8,
							this.pTagExtendedMag.sub(30f, 5f), LColor.wheat,
							0f, v, 1f);
				} else if (Help.profession == Help.Profession.Commander) {
					v = Screen.ariel14.getOrigin("" + Help.numSkill9);
					batch.drawString(Screen.ariel14, "" + Help.numSkill9,
							this.pTagArtillery.sub(30f, 5f), LColor.wheat, 0f,
							v, 1f);
					v = Screen.ariel14.getOrigin("" + Help.numSkill10);
					batch.drawString(Screen.ariel14, "" + Help.numSkill10,
							this.pTagBoost.sub(30f, 5f), LColor.wheat, 0f, v,
							1f);
				}
				for (Button button : super.buttonList) {
					if (!button.isPrerequisiteMet) {
						RectBox sourceRectangle = null;
						batch.draw(maskSkill, button.position, sourceRectangle,
								LColor.white, 0f, button.origin, 1f,
								SpriteEffects.None);
					}
				}
				if (this.tagSelected != null) {
					batch.draw(t2DSkillDetail, 397f, 240f, null, LColor.white,
							0f, (t2DSkillDetail.getWidth() / 2),
							(t2DSkillDetail.getHeight() / 2), 1f,
							SpriteEffects.None);
					batch.draw(this.tagSelected.texture, 210f, 190f,
							LColor.white);
					batch.drawString(Screen.myFont,
							this.tagSelected.description, 200f, 130f,
							LColor.wheat);
					batch.drawString(Screen.ariel14,
							this.tagSelected.subDescription, 320f, 190f,
							LColor.wheat);
					batch.drawString(Screen.ariel14,
							this.tagSelected.reqDescription, 320f, 275f,
							LColor.wheat);
					this.buttonCancel.Draw(batch);
					if (this.isDetailShowing) {
						this.buttonConfirm.Draw(batch);
					} else {
						batch.draw(t2DPreReqNotMet, 220f, 270f, null,
								Global.Pool.getColor(1f, 1f, 1f, 0.7f),
								MathUtils.toDegrees(-0.3926991f), 0f, 0f, 1f,
								SpriteEffects.None);
					}
				}
			}
		}
	}