use of eidolons.libgdx.bf.generic.ImageContainer in project Eidolons by IDemiurge.
the class ValueContainer method init.
protected void init(TextureRegion texture, String name, String value) {
imageContainer = addElement(null);
setName(name);
if (texture != null) {
imageContainer.setActor(new ImageContainer(new Image(texture))).height(texture.getRegionHeight()).width(texture.getRegionWidth()).center();
} else {
imageContainer.fill(false).expand(0, 0);
}
if (isVertical()) {
row();
}
this.nameContainer = addElement(null);
if (isVertical()) {
row();
}
if (name != null) {
setName(name);
nameLabel = new Label(name, style);
}
nameContainer.setActor(nameLabel).grow().center().padRight(12);
valueContainer = addElement(null);
if (isVertical()) {
row();
}
if (StringUtils.isNotEmpty(value)) {
valueLabel = new Label(value, style);
}
valueContainer.setActor(valueLabel).grow().center();
setNameAlignment(Align.center);
setValueAlignment(Align.center);
initSize();
}
use of eidolons.libgdx.bf.generic.ImageContainer in project Eidolons by IDemiurge.
the class MapStage method updateBackground.
private void updateBackground(String s, boolean nextMapUpdate) {
final String path = s;
TextureRegion backTexture = getOrCreateR(path);
ImageContainer map = this.map;
if (nextMapUpdate) {
map = this.nextMap;
}
map.setContents(new Image(backTexture));
lastNextMapAlphaPercentage = 0;
}
use of eidolons.libgdx.bf.generic.ImageContainer in project Eidolons by IDemiurge.
the class MapAlphaLayers method init.
public void init() {
for (File subdir : FileManager.getFilesFromDirectory(getMainPath(), true)) {
MAP_LAYER_TYPE type = new EnumMaster<MAP_LAYER_TYPE>().retrieveEnumConst(MAP_LAYER_TYPE.class, subdir.getName().toUpperCase());
if (type != null)
if (subdir.isDirectory())
for (File img : subdir.listFiles()) // FileManager.getFilesFromDirectory(subdir.getPath(), true)
{
if (!FileManager.isImageFile(img.getName()))
continue;
String path = img.getPath();
try {
path = StringMaster.removePreviousPathSegments(img.getPath(), PathFinder.getImagePath());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
Image image = new Image(TextureCache.getOrCreateR(path));
ImageContainer container = new ImageContainer(image);
container.setFluctuateAlpha(true);
container.setFluctuatingAlpha(RandomWizard.getRandomFloatBetween(type.alphaMin, type.alphaMax));
container.setFluctuatingAlphaPauseDuration(type.pauseAtZero);
container.setFluctuatingFullAlphaDuration(type.pauseAtFull);
container.setFluctuatingAlphaMin(type.alphaMin);
container.setFluctuatingAlphaMax(type.alphaMax);
container.setAlphaStep(type.alphaStep);
container.setFluctuatingAlphaRandomness(type.randomness);
if (img.getName().split("_").length < 2)
continue;
Coordinates c = new Coordinates(true, img.getName().split("_")[1]);
container.setPosition(c.x, MapScreen.defaultSize - c.y);
for (DAY_TIME sub : type.times) MapMaster.addToListMap(map, sub, container);
}
}
initialized = true;
}
Aggregations