fixed backgroundimage

This commit is contained in:
TheCodeBoat 2014-02-02 22:03:52 +01:00
parent 3b120313ee
commit 0d47e9a399

View File

@ -19,7 +19,9 @@ package org.wyrez.shootingstars.gui;
import com.jme3.asset.AssetManager; import com.jme3.asset.AssetManager;
import com.jme3.math.Vector2f; import com.jme3.math.Vector2f;
import com.jme3.ui.Picture; import com.jme3.ui.Picture;
import tonegod.gui.controls.text.Label;
import tonegod.gui.controls.windows.Panel; import tonegod.gui.controls.windows.Panel;
import tonegod.gui.core.Element;
import tonegod.gui.core.Screen; import tonegod.gui.core.Screen;
/** /**
@ -41,13 +43,14 @@ public abstract class BackgroundedGui extends Panel implements Gui {
addBackground(texture); addBackground(texture);
} }
private void addBackground(String texture) { private void addBackground(String texture) {
Picture bgImage = new Picture("Background"); Picture bgImage = new Picture("Background");
bgImage.setPosition(0f, 0f); bgImage.setPosition(0f, 0f);
bgImage.setImage(assetManager, texture, false); bgImage.setImage(assetManager, texture, false);
bgImage.setWidth(screen.getWidth()); bgImage.setWidth(screen.getWidth());
bgImage.setHeight(screen.getHeight()); bgImage.setHeight(screen.getHeight());
this.setWidth(screen.getWidth());
this.setHeight(screen.getHeight());
this.attachChild(bgImage); this.attachChild(bgImage);
} }
} }