Extract ImageLayer interface to :api
This commit is contained in:
@@ -2,11 +2,14 @@ package com.bartlomiejpluta.base.api.game.context;
|
||||
|
||||
import com.bartlomiejpluta.base.api.game.camera.Camera;
|
||||
import com.bartlomiejpluta.base.api.game.entity.Entity;
|
||||
import com.bartlomiejpluta.base.api.game.map.Image;
|
||||
|
||||
public interface Context {
|
||||
void openMap(String mapUid);
|
||||
|
||||
Entity createEntity(String entitySetUid);
|
||||
|
||||
Image getImage(String imageUid);
|
||||
|
||||
Camera getCamera();
|
||||
}
|
||||
|
||||
@@ -5,10 +5,20 @@ import com.bartlomiejpluta.base.api.game.entity.Movement;
|
||||
import org.joml.Vector2f;
|
||||
|
||||
public interface GameMap {
|
||||
float getWidth();
|
||||
|
||||
float getHeight();
|
||||
|
||||
int getRows();
|
||||
|
||||
int getColumns();
|
||||
|
||||
Vector2f getSize();
|
||||
|
||||
TileLayer getTileLayer(int layerIndex);
|
||||
|
||||
ImageLayer getImageLayer(int layerIndex);
|
||||
|
||||
void addEntity(int objectLayerIndex, Entity entity);
|
||||
|
||||
void removeEntity(int objectLayerIndex, Entity entity);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.bartlomiejpluta.base.api.game.map;
|
||||
|
||||
import com.bartlomiejpluta.base.api.internal.object.Placeable;
|
||||
import com.bartlomiejpluta.base.api.internal.render.Renderable;
|
||||
|
||||
public interface Image extends Placeable, Renderable {
|
||||
int getPrimaryWidth();
|
||||
|
||||
int getPrimaryHeight();
|
||||
|
||||
int getFactor();
|
||||
|
||||
int getWidth();
|
||||
|
||||
int getHeight();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.bartlomiejpluta.base.api.game.map;
|
||||
|
||||
public interface ImageLayer extends Layer {
|
||||
void setImage(Image image);
|
||||
|
||||
void setOpacity(float opacity);
|
||||
|
||||
void setPosition(float x, float y);
|
||||
|
||||
void setMode(ImageLayerMode mode);
|
||||
|
||||
void setScale(float scaleX, float scaleY);
|
||||
|
||||
void setParallax(boolean parallax);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.bartlomiejpluta.base.api.game.map;
|
||||
|
||||
public enum ImageLayerMode {
|
||||
NORMAL,
|
||||
FIT_MAP,
|
||||
FIT_SCREEN
|
||||
}
|
||||
Reference in New Issue
Block a user