From 523cad4ec547fe4ac6be8ff0281ab3af78a130d1 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 8 Jun 2024 22:48:58 +0500 Subject: feat: missing texture --- core/src/kz/ilotterytea/maxon/MaxonConstants.java | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'core/src/kz/ilotterytea/maxon/MaxonConstants.java') diff --git a/core/src/kz/ilotterytea/maxon/MaxonConstants.java b/core/src/kz/ilotterytea/maxon/MaxonConstants.java index 298e6d8..c9f7878 100644 --- a/core/src/kz/ilotterytea/maxon/MaxonConstants.java +++ b/core/src/kz/ilotterytea/maxon/MaxonConstants.java @@ -2,6 +2,9 @@ package kz.ilotterytea.maxon; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Pixmap; +import com.badlogic.gdx.graphics.Texture; import kz.ilotterytea.maxon.utils.OsUtils; import java.text.DecimalFormat; @@ -36,4 +39,27 @@ public class MaxonConstants { public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/M/yyyy hh:mm:ss"); public static final long startTime = System.currentTimeMillis(); + public static final Texture MISSING_TEXTURE; + + static { + Pixmap pixmap = new Pixmap(4, 4, Pixmap.Format.RGBA8888); + + int checkers = 2; + int tileSize = pixmap.getWidth() / checkers; + + for (int y = 0; y < checkers; y++) { + for (int x = 0; x < checkers; x++) { + if ((x + y) % 2 == 0){ + pixmap.setColor(Color.MAGENTA); + } else { + pixmap.setColor(Color.BLACK); + } + + pixmap.fillRectangle(x * tileSize, y * tileSize, tileSize, tileSize); + } + } + + MISSING_TEXTURE = new Texture(pixmap); + pixmap.dispose(); + } } -- cgit v1.2.3