From 75f14cb3d46f91b5278e92306d8f9d44e7b4a050 Mon Sep 17 00:00:00 2001 From: Rosia E Evans Date: Sun, 21 Apr 2024 12:42:30 +0100 Subject: [PATCH 1/2] adds green backing ready for criteria --- core/src/com/monjaro/gamejam/SegmentUI.java | 32 +++++++++++++++++++++ core/src/com/monjaro/gamejam/main/Game.java | 5 ++++ 2 files changed, 37 insertions(+) create mode 100644 core/src/com/monjaro/gamejam/SegmentUI.java diff --git a/core/src/com/monjaro/gamejam/SegmentUI.java b/core/src/com/monjaro/gamejam/SegmentUI.java new file mode 100644 index 0000000..62d116a --- /dev/null +++ b/core/src/com/monjaro/gamejam/SegmentUI.java @@ -0,0 +1,32 @@ +package com.monjaro.gamejam; + +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.monjaro.gamejam.main.Actor; + +public class SegmentUI extends Actor { + + private Texture separator; + private Texture criteriaSheet; + + @Override + public void tick() { + + } + + @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(); + + } +} diff --git a/core/src/com/monjaro/gamejam/main/Game.java b/core/src/com/monjaro/gamejam/main/Game.java index e86a0de..fe20b7c 100644 --- a/core/src/com/monjaro/gamejam/main/Game.java +++ b/core/src/com/monjaro/gamejam/main/Game.java @@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.ScreenUtils; +import com.monjaro.gamejam.SegmentUI; import com.monjaro.gamejam.segment.DualSegment; import com.monjaro.gamejam.segment.KinSegment; import com.monjaro.gamejam.segment.OlympicSegment; @@ -31,6 +32,7 @@ public class Game extends ApplicationAdapter { private RoundData roundData; private UI ui; + private SegmentUI segUi; @Override public void create() { @@ -41,6 +43,7 @@ public class Game extends ApplicationAdapter { ui = new UI(50, 280, 10); roundData = new RoundData(10); + segUi = new SegmentUI(); Face.setBlankFaceSprite(new Texture("blank_die_face.png")); Face.setPipSprite(new Texture("pip.png")); @@ -115,6 +118,8 @@ public class Game extends ApplicationAdapter { ui.render(batch); + segUi.render(batch); + batch.end(); } From e2dc9dcc4ba5a9619dca78fc127a623f0b2786de Mon Sep 17 00:00:00 2001 From: Rosia E Evans Date: Sun, 21 Apr 2024 12:46:53 +0100 Subject: [PATCH 2/2] removes green square temporarily --- core/src/com/monjaro/gamejam/SegmentUI.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/com/monjaro/gamejam/SegmentUI.java b/core/src/com/monjaro/gamejam/SegmentUI.java index 62d116a..27aba8d 100644 --- a/core/src/com/monjaro/gamejam/SegmentUI.java +++ b/core/src/com/monjaro/gamejam/SegmentUI.java @@ -18,15 +18,15 @@ public class SegmentUI extends Actor { @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.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(); } }