unhardcode logic display background color (#12178)

This commit is contained in:
kay
2026-07-03 20:43:27 -04:00
committed by GitHub
parent c2103247ed
commit 5ad9a65a15
2 changed files with 3 additions and 2 deletions
@@ -52,6 +52,7 @@ public class LogicDisplay extends Block{
public int displaySize = 64;
public float scaleFactor = 1f;
public Color backgroundColor = Pal.darkerMetal;
static{
Events.on(ResetEvent.class, e -> displays.clear());
@@ -135,7 +136,7 @@ public class LogicDisplay extends Block{
if(buffer == null){
buffer = new FrameBuffer(displaySize, displaySize);
//clear the buffer - some OSs leave garbage in it
buffer.begin(Pal.darkerMetal);
buffer.begin(backgroundColor);
buffer.end();
}
}
@@ -187,7 +187,7 @@ public class TileableLogicDisplay extends LogicDisplay{
Draw.proj(0, 0, root.buffer.getWidth(), root.buffer.getHeight());
//clear the buffer - some OSs leave garbage in it
root.buffer.begin(Pal.darkerMetal);
root.buffer.begin(backgroundColor);
if(root.prevBuffers != null){
for(var other : root.prevBuffers){
Draw.rect(Draw.wrap(other.buffer.getTexture()), (other.x - originX) * 32 + other.buffer.getWidth() / 2f, (other.y - originY) * 32 + other.buffer.getHeight() / 2f, other.buffer.getWidth(), -other.buffer.getHeight());