Arc compatibility update

This commit is contained in:
Anuken
2018-12-27 15:47:17 -05:00
parent 3b42b604e1
commit db546412f1
75 changed files with 255 additions and 285 deletions

View File

@@ -23,11 +23,11 @@ public class GridImage extends Element{
int jumpy = (int) (Math.max(minspace, yspace) / yspace);
for(int x = 0; x <= imageWidth; x += jumpx){
Fill.rect().set((int) (getX() + xspace * x - s), getY() - s, 2, getHeight() + (x == imageWidth ? 1 : 0));
Fill.crect((int) (getX() + xspace * x - s), getY() - s, 2, getHeight() + (x == imageWidth ? 1 : 0));
}
for(int y = 0; y <= imageHeight; y += jumpy){
Fill.rect().set(getX() - s, (int) (getY() + y * yspace - s), getWidth(), 2);
Fill.crect(getX() - s, (int) (getY() + y * yspace - s), getWidth(), 2);
}
}

View File

@@ -18,7 +18,7 @@ public class Minimap extends Container<Element>{
public void draw(){
if(renderer.minimap.getRegion() == null) return;
Draw.rect().tex(renderer.minimap.getRegion()).set(x, y, width, height);
Draw.rect(renderer.minimap.getRegion(), x + width/2f, y + height/2f, width, height);
if(renderer.minimap.getTexture() != null){
renderer.minimap.drawEntities(x, y, width, height);

View File

@@ -99,7 +99,7 @@ public class GenViewDialog extends FloatingDialog{
float drawX = x + width/2f+ wx * padSectorSize - tx * padSectorSize - panX % padSectorSize;
float drawY = y + height/2f + wy * padSectorSize - ty * padSectorSize - panY % padSectorSize;
Draw.rect().tex(map.get(wx, wy)).set(drawX, drawY, padSectorSize, padSectorSize);
Draw.rect(Draw.wrap(map.get(wx, wy)), drawX + padSectorSize/2f, drawY + padSectorSize/2f, padSectorSize, padSectorSize);
}
}
}

View File

@@ -202,13 +202,13 @@ public class SectorsDialog extends FloatingDialog{
if(sector == null || sector.texture == null){
Draw.reset();
Draw.rect("empty-sector", drawX, drawY, sectorSize, sectorSize);
Draw.rect(("empty-sector"), drawX, drawY, sectorSize, sectorSize);
int i = 0;
for(Point2 point : Geometry.d4){
Sector other = world.sectors.get(sectorX + point.x, sectorY + point.y);
if(other != null){
Draw.rect("sector-edge", drawX, drawY, sectorSize, sectorSize).rot(i*90);
Draw.rect(("sector-edge"), drawX, drawY, sectorSize, sectorSize, i*90);
}
i ++;
@@ -217,7 +217,7 @@ public class SectorsDialog extends FloatingDialog{
}
Draw.colorl(!sector.complete ? 0.3f : 1f);
Draw.rect().tex(sector.texture).center(drawX, drawY, sectorSize, sectorSize);
Draw.rect(Draw.wrap(sector.texture), drawX, drawY, sectorSize, sectorSize);
if(sector.missions.size == 0) continue;
@@ -250,16 +250,16 @@ public class SectorsDialog extends FloatingDialog{
}
Draw.color(selectColor);
Draw.rect("sector-select", drawX, drawY, sectorSize, sectorSize);
Draw.rect(("sector-select"), drawX, drawY, sectorSize, sectorSize);
Draw.color(backColor);
Draw.alpha(0.75f * backColor.a);
Draw.rect("icon-mission-background", drawX, drawY, Unit.dp.scl(18f * 5), Unit.dp.scl(18f * 5));
Draw.rect(("icon-mission-background"), drawX, drawY, Unit.dp.scl(18f * 5), Unit.dp.scl(18f * 5));
float size = Unit.dp.scl(10f * 5);
Draw.color(iconColor);
Draw.rect(region, drawX, drawY, size, size);
Draw.rect((region), drawX, drawY, size, size);
}
}

View File

@@ -7,7 +7,6 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.scene.Group;
import io.anuke.arc.scene.ui.layout.Unit;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.graphics.Shaders;
import static io.anuke.mindustry.Vars.state;
@@ -18,12 +17,10 @@ public class BackgroundFragment extends Fragment{
public void build(Group parent){
Core.scene.table().addRect((a, b, w, h) -> {
Draw.colorl(0.1f);
Fill.rect().set(0, 0, w, h);
Draw.color(Palette.accent);
Fill.rect(0, 0, w, h);
Draw.shader(Shaders.menu);
Fill.rect().set(0, 0, w, h);
Fill.rect(0, 0, w, h);
Draw.shader();
Draw.color();
boolean portrait = Core.graphics.getWidth() < Core.graphics.getHeight();
float logoscl = (int) Unit.dp.scl(7) * (portrait ? 5f / 7f : 1f);
@@ -32,7 +29,7 @@ public class BackgroundFragment extends Fragment{
float logoh = logo.getHeight() * logoscl;
Draw.color();
Draw.rect().tex(logo).set((int) (w / 2 - logow / 2), (int) (h - logoh + 15 - Unit.dp.scl(portrait ? 30f : 0)), logow, logoh);
Draw.rect(logo, (int) (w / 2 - logow / 2), (int) (h - logoh + 15 - Unit.dp.scl(portrait ? 30f : 0)), logow, logoh);
}).visible(() -> state.is(State.menu)).grow();
}
}

View File

@@ -158,7 +158,7 @@ public class ChatFragment extends Table{
Draw.color(shadowColor);
if(chatOpen){
Fill.rect().set(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
}
super.draw();
@@ -185,7 +185,7 @@ public class ChatFragment extends Table{
Draw.color(0, 0, 0, shadowColor.a * (fadetime - i));
}
Fill.rect().set(offsetx, theight - layout.height - 2, textWidth + Unit.dp.scl(4f), layout.height + textspacing);
Fill.crect(offsetx, theight - layout.height - 2, textWidth + Unit.dp.scl(4f), layout.height + textspacing);
Draw.color(shadowColor);
font.getCache().draw();