added outline for bonuscards
This commit is contained in:
@@ -15,7 +15,7 @@ enum MusicAsset {
|
||||
GAME_3("TheSynthRave.wav", 1.0f),
|
||||
GAME_4("LaserParty.wav", 1.0f),
|
||||
GAME_5("RetroNoir.wav", 1.0f),
|
||||
GAME_6("RetroNoir.wav.wav", 1.0f);
|
||||
GAME_6("SpaceInvaders.wav", 1.0f);
|
||||
|
||||
private final String path;
|
||||
private final boolean loop;
|
||||
|
||||
@@ -6,11 +6,14 @@
|
||||
import com.jme3.material.Material;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.post.FilterPostProcessor;
|
||||
import com.jme3.post.filters.ComposeFilter;
|
||||
import com.jme3.renderer.Camera;
|
||||
import com.jme3.renderer.RenderManager;
|
||||
import com.jme3.renderer.ViewPort;
|
||||
import com.jme3.scene.Node;
|
||||
import com.jme3.scene.Spatial;
|
||||
import com.jme3.texture.Image;
|
||||
import com.jme3.texture.Texture2D;
|
||||
import pp.mdga.client.Asset;
|
||||
|
||||
import java.util.*;
|
||||
@@ -24,12 +27,14 @@ public class CardLayer extends AbstractAppState {
|
||||
private List<Spatial> cardBuffer;
|
||||
private final FilterPostProcessor fpp;
|
||||
private final Camera overlayCam;
|
||||
Texture2D backTexture;
|
||||
|
||||
public CardLayer(FilterPostProcessor fpp, Camera overlayCam) {
|
||||
public CardLayer(FilterPostProcessor fpp, Camera overlayCam, Texture2D backTexture) {
|
||||
this.overlayCam = overlayCam;
|
||||
this.fpp = fpp;
|
||||
this.cardBuffer = new ArrayList<>();
|
||||
init = false;
|
||||
this.backTexture = backTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,6 +46,8 @@ public void initialize(AppStateManager stateManager, Application app ) {
|
||||
view.setEnabled(true);
|
||||
view.setClearFlags(false, true, false);
|
||||
view.attachScene(root);
|
||||
fpp.setFrameBufferFormat(Image.Format.RGBA8);
|
||||
fpp.addFilter(new ComposeFilter(backTexture));
|
||||
view.addProcessor(fpp);
|
||||
|
||||
if(!init) init = true;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import com.jme3.renderer.Camera;
|
||||
import com.jme3.scene.Node;
|
||||
import com.jme3.scene.Spatial;
|
||||
import com.jme3.texture.Texture2D;
|
||||
import pp.mdga.client.Asset;
|
||||
import pp.mdga.client.MdgaApp;
|
||||
import pp.mdga.game.BonusCard;
|
||||
@@ -31,14 +32,16 @@ public class GuiHandler {
|
||||
private static final Vector3f MARGIN = new Vector3f(2.5f,0,0);
|
||||
|
||||
private final FilterPostProcessor fpp;
|
||||
Texture2D backTexture;
|
||||
|
||||
public GuiHandler(MdgaApp app) {
|
||||
public GuiHandler(MdgaApp app, Texture2D backTexture) {
|
||||
this.app = app;
|
||||
this.fpp = new FilterPostProcessor(app.getAssetManager());
|
||||
this.backTexture = backTexture;
|
||||
}
|
||||
|
||||
public void init(){
|
||||
cardLayer = new CardLayer(fpp, createOverlayCam());
|
||||
cardLayer = new CardLayer(fpp, createOverlayCam(), backTexture);
|
||||
app.getStateManager().attach(cardLayer);
|
||||
ownCardsMap = new HashMap<>();
|
||||
playerFont = app.getAssetManager().loadFont("Fonts/Gunplay.fnt");
|
||||
@@ -46,8 +49,6 @@ public void init(){
|
||||
app.getGuiNode().attachChild(playerNameNode);
|
||||
playerOrder = new ArrayList<>();
|
||||
colorNameMap = new HashMap<>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
import com.jme3.input.controls.KeyTrigger;
|
||||
import com.jme3.input.controls.MouseButtonTrigger;
|
||||
import com.jme3.post.FilterPostProcessor;
|
||||
import com.jme3.post.filters.ComposeFilter;
|
||||
import com.jme3.texture.FrameBuffer;
|
||||
import com.jme3.texture.Image;
|
||||
import com.jme3.texture.Texture2D;
|
||||
import pp.mdga.client.board.BoardHandler;
|
||||
import pp.mdga.client.board.CameraHandler;
|
||||
import pp.mdga.client.dialog.SingleButtonLeftDialog;
|
||||
@@ -36,7 +40,13 @@ public GameView(MdgaApp app) {
|
||||
this.boardHandler = new BoardHandler(app, fpp);
|
||||
app.getViewPort().addProcessor(fpp);
|
||||
|
||||
this.guiHandler = new GuiHandler(app);
|
||||
FrameBuffer backFrameBuffer = new FrameBuffer(app.getCamera().getWidth(), app.getCamera().getHeight(), 1);
|
||||
Texture2D backTexture = new Texture2D(app.getCamera().getWidth(), app.getCamera().getHeight(), Image.Format.RGBA8);
|
||||
backFrameBuffer.setDepthTarget(FrameBuffer.FrameBufferTarget.newTarget(Image.Format.Depth));
|
||||
backFrameBuffer.addColorTarget(FrameBuffer.FrameBufferTarget.newTarget(backTexture));
|
||||
app.getViewPort().setOutputFrameBuffer(backFrameBuffer);
|
||||
|
||||
this.guiHandler = new GuiHandler(app, backTexture);
|
||||
|
||||
leaveButton = new SingleButtonLeftDialog(app, settingsNode, "Verlassen", () -> leaveGame());
|
||||
|
||||
|
||||
BIN
Projekte/mdga/client/src/main/resources/Music/SpaceInvaders.wav
Normal file
BIN
Projekte/mdga/client/src/main/resources/Music/SpaceInvaders.wav
Normal file
Binary file not shown.
Reference in New Issue
Block a user