merge has been 'dealt with'
This commit is contained in:
commit
2b50774435
9 changed files with 61 additions and 19 deletions
Binary file not shown.
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 3 KiB |
BIN
assets/pip.png
BIN
assets/pip.png
Binary file not shown.
Before Width: | Height: | Size: 977 B After Width: | Height: | Size: 855 B |
Binary file not shown.
Binary file not shown.
|
@ -4,29 +4,67 @@ import com.badlogic.gdx.Gdx;
|
|||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.monjaro.gamejam.main.Actor;
|
||||
import com.monjaro.gamejam.main.Game;
|
||||
import com.monjaro.gamejam.main.Round;
|
||||
|
||||
public class SegmentUI extends Actor {
|
||||
|
||||
private Texture separator;
|
||||
private Texture criteriaSheet;
|
||||
private static Texture separator;
|
||||
private static Texture criteriaSheet;
|
||||
private Rectangle rect;
|
||||
private Game game;
|
||||
|
||||
public SegmentUI(Rectangle rect) {
|
||||
this.rect = rect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
|
||||
}
|
||||
|
||||
public void setGame(Game game){
|
||||
this.game = game;
|
||||
}
|
||||
|
||||
public static void setSeparator(Texture texture) {
|
||||
separator = texture;
|
||||
}
|
||||
|
||||
public static void setCriteriaSheet(Texture texture) {
|
||||
criteriaSheet = texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(SpriteBatch batch) {
|
||||
// batch.end();
|
||||
//
|
||||
// ShapeRenderer renderer = new ShapeRenderer();
|
||||
// renderer.begin(ShapeRenderer.ShapeType.Filled);
|
||||
// renderer.setColor(0.4f, 0.7f, 0.4f, 1);
|
||||
// renderer.rect(0, (Gdx.graphics.getHeight()/3)*2, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/3);
|
||||
// renderer.end();
|
||||
//
|
||||
// batch.begin();
|
||||
batch.end();
|
||||
|
||||
ShapeRenderer renderer = new ShapeRenderer();
|
||||
renderer.begin(ShapeRenderer.ShapeType.Filled);
|
||||
renderer.setColor(0.7f, 0.4f, 0.6f, 1);
|
||||
renderer.rect(rect.x, rect.y, rect.width, rect.height);
|
||||
renderer.end();
|
||||
|
||||
batch.begin();
|
||||
|
||||
int spriteWidth = 75;
|
||||
int spriteHeight = 200;
|
||||
Round round = game.getRound();
|
||||
|
||||
int numOfSegments = round.getSegments().size();
|
||||
for (int i = 0; i < numOfSegments; i++) {
|
||||
int criteriaType = round.getSegments().get(i).getSpriteColumn();
|
||||
int criteriaQuantity = round.getSegments().get(i).getSpriteRow();
|
||||
batch.draw(criteriaSheet,
|
||||
rect.x + ((rect.width/(numOfSegments+1))*(i+1))-spriteWidth/2, ((rect.y + rect.height/2)-spriteHeight/2),
|
||||
spriteWidth, spriteHeight,
|
||||
spriteWidth*criteriaType, spriteHeight*(criteriaQuantity),
|
||||
spriteWidth, spriteHeight,
|
||||
false, false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.badlogic.gdx.Input;
|
|||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.utils.ScreenUtils;
|
||||
import com.monjaro.gamejam.SegmentUI;
|
||||
import com.monjaro.gamejam.segment.*;
|
||||
|
@ -37,15 +38,19 @@ public class Game extends ApplicationAdapter {
|
|||
font.getData().markupEnabled = true;
|
||||
img = new Texture("badlogic.jpg");
|
||||
|
||||
segUi = new SegmentUI();
|
||||
segUi = new SegmentUI(new Rectangle(0, (Gdx.graphics.getHeight()/3)*2, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/3));
|
||||
segUi.setGame(this);
|
||||
|
||||
ui = new UI(this, 50, 280);
|
||||
|
||||
round = generateRound(0);
|
||||
|
||||
Face.setBlankFaceSprite(new Texture("blank_die_face.png"));
|
||||
Face.setPipSprite(new Texture("pip.png"));
|
||||
Die.setLockedSprite(new Texture("locked_die_border.png"));
|
||||
UI.setRerollTexture(new Texture("reroll_symbol.png"));
|
||||
SegmentUI.setCriteriaSheet(new Texture("criteria.png"));
|
||||
// SegmentUI.setCriteriaSheet(""); not made yet
|
||||
|
||||
float divide = Gdx.graphics.getWidth() / 6f;
|
||||
for (int i = 0; i < 5; i++) {
|
||||
|
|
|
@ -62,12 +62,11 @@ public class DualSegment extends Segment {
|
|||
|
||||
@Override
|
||||
public int getSpriteColumn() {
|
||||
return 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteRow() {
|
||||
return 0;
|
||||
return firstTrio ? 1 : 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -48,7 +48,7 @@ public class KinSegment extends Segment { //multiple dice of the same value
|
|||
|
||||
@Override
|
||||
public int getSpriteRow() {
|
||||
return 0;
|
||||
return requirement - 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,12 +55,12 @@ public class OlympicSegment extends Segment {
|
|||
|
||||
@Override
|
||||
public int getSpriteColumn() {
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpriteRow() {
|
||||
return 0;
|
||||
return length - 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue