Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.ptl.chees.stages.actors;
- import com.badlogic.gdx.graphics.Texture;
- import com.badlogic.gdx.graphics.g2d.Batch;
- import com.badlogic.gdx.scenes.scene2d.Actor;
- public class BoardActor extends Actor {
- private Texture texture;
- private Texture pawn_b;
- private Texture rook_b;
- private Texture knight_b;
- private Texture bishop_b;
- private Texture queen_b;
- private Texture king_b;
- private Texture pawn_w;
- private Texture rook_w;
- private Texture knight_w;
- private Texture bishop_w;
- private Texture queen_w;
- private Texture king_w;
- public BoardActor(float width, float height) {
- setSize(width, height);
- texture = new Texture("board.jpg");
- pawn_b = new Texture("pawn-b.png");
- rook_b = new Texture("rook-b.png");
- knight_b = new Texture("knight-b.png");
- bishop_b = new Texture("bishop-b.png");
- king_b = new Texture("king-b.png");
- queen_b = new Texture("queen-b.png");
- pawn_w = new Texture("pawn-w.png");
- rook_w = new Texture("rook-w.png");
- knight_w = new Texture("knight-w.png");
- bishop_w = new Texture("bishop-w.png");
- king_w = new Texture("king-w.png");
- queen_w = new Texture("queen-w.png");
- }
- @Override
- public void draw(Batch batch, float parentAlpha) {
- batch.draw(texture, 0, 0, getWidth(), getHeight());
- batch.draw(pawn_b, 61, 117, 40, 40);
- batch.draw(pawn_b, 116, 117, 40, 40);
- batch.draw(pawn_b, 171, 117, 40, 40);
- batch.draw(pawn_b, 225, 117, 40, 40);
- batch.draw(pawn_b, 279, 117, 40, 40);
- batch.draw(pawn_b, 334, 117, 40, 40);
- batch.draw(pawn_b, 387, 117, 40, 40);
- batch.draw(pawn_b, 442, 117, 40, 40);
- batch.draw(rook_b, 61, 62, 40, 40);
- batch.draw(rook_b, 442, 62, 40, 40);
- batch.draw(knight_b, 116, 62, 40, 40);
- batch.draw(knight_b, 387, 62, 40, 40);
- batch.draw(bishop_b, 171, 62, 40, 40);
- batch.draw(bishop_b, 334, 62, 40, 40);
- batch.draw(king_b, 225, 62, 40, 40);
- batch.draw(queen_b, 279, 62, 40, 40);
- batch.draw(pawn_w, 61, 388, 40, 40);
- batch.draw(pawn_w, 116, 388, 40, 40);
- batch.draw(pawn_w, 171, 388, 40, 40);
- batch.draw(pawn_w, 225, 388, 40, 40);
- batch.draw(pawn_w, 279, 388, 40, 40);
- batch.draw(pawn_w, 334, 388, 40, 40);
- batch.draw(pawn_w, 387, 388, 40, 40);
- batch.draw(pawn_w, 442, 388, 40, 40);
- batch.draw(rook_w, 61, 443, 40, 40);
- batch.draw(rook_w, 442, 443, 40, 40);
- batch.draw(knight_w, 116, 443, 40, 40);
- batch.draw(knight_w, 387, 443, 40, 40);
- batch.draw(bishop_w, 171, 443, 40, 40);
- batch.draw(bishop_w, 334, 443, 40, 40);
- batch.draw(king_w, 279, 443, 40, 40);
- batch.draw(queen_w, 225, 443, 40, 40);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement