Containers PropertyCards

This commit is contained in:
Simon Wilkening 2024-12-10 03:22:26 +01:00
parent 2a7cbeed89
commit 5306208107
4 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package pp.monopoly.client.gui.popups; package pp.monopoly.client.gui.popups;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.simsilica.lemur.Button; import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container; import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label; import com.simsilica.lemur.Label;
@ -41,6 +42,7 @@ public class BuildingPropertyCard extends Dialog implements PopupDialog {
buildingPropertyContainer = new Container(); buildingPropertyContainer = new Container();
buildingPropertyContainer.setBackground(new QuadBackgroundComponent(field.getColor().getColor())); buildingPropertyContainer.setBackground(new QuadBackgroundComponent(field.getColor().getColor()));
addContentToContainer(buildingPropertyContainer, field); addContentToContainer(buildingPropertyContainer, field);
buildingPropertyContainer.setPreferredSize(new Vector3f(360,420,1));
// Create the background container // Create the background container
backgroundContainer = new Container(); backgroundContainer = new Container();
@ -50,6 +52,9 @@ public class BuildingPropertyCard extends Dialog implements PopupDialog {
float padding = 10f; float padding = 10f;
backgroundContainer.setPreferredSize(buildingPropertyContainer.getPreferredSize().addLocal(padding, padding, 0)); backgroundContainer.setPreferredSize(buildingPropertyContainer.getPreferredSize().addLocal(padding, padding, 0));
System.out.println(backgroundContainer.getPreferredSize());
// Position the containers // Position the containers
centerContainers(padding); centerContainers(padding);
} }

View File

@ -3,6 +3,7 @@ package pp.monopoly.client.gui.popups;
import com.jme3.material.Material; import com.jme3.material.Material;
import com.jme3.material.RenderState.BlendMode; import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry; import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Quad; import com.jme3.scene.shape.Quad;
import com.simsilica.lemur.Button; import com.simsilica.lemur.Button;
@ -72,6 +73,7 @@ public class FoodFieldCard extends Dialog implements PopupDialog {
private void createBackgroundContainer() { private void createBackgroundContainer() {
backgroundContainer = new Container(); backgroundContainer = new Container();
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Light gray background backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Light gray background
} }
/** /**
@ -82,6 +84,7 @@ public class FoodFieldCard extends Dialog implements PopupDialog {
private void createFoodFieldContainer(FoodField field) { private void createFoodFieldContainer(FoodField field) {
foodFieldContainer = new Container(); foodFieldContainer = new Container();
foodFieldContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.9f))); foodFieldContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.9f)));
foodFieldContainer.setPreferredSize(new Vector3f(360,420,1));
// Title // Title
Label title = foodFieldContainer.addChild(new Label(field.getName(), new ElementId("label-Bold"))); Label title = foodFieldContainer.addChild(new Label(field.getName(), new ElementId("label-Bold")));

View File

@ -1,6 +1,7 @@
package pp.monopoly.client.gui.popups; package pp.monopoly.client.gui.popups;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.simsilica.lemur.Button; import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container; import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label; import com.simsilica.lemur.Label;
@ -52,6 +53,7 @@ public class GateFieldCard extends Dialog implements PopupDialog {
private void createBackgroundContainer() { private void createBackgroundContainer() {
backgroundContainer = new Container(); backgroundContainer = new Container();
backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Light gray background backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Light gray background
gateFieldContainer.setPreferredSize(new Vector3f(360,420,1));
} }
/** /**