Cursor antialiasing

This commit is contained in:
Anuken 2019-08-04 09:41:25 -04:00
parent 81909bd1a9
commit ecd30094b1
7 changed files with 14 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 336 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 375 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 350 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 230 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 368 B

Before After
Before After

View file

@ -31,9 +31,6 @@ import static io.anuke.arc.scene.actions.Actions.*;
import static io.anuke.mindustry.Vars.*;
public class UI implements ApplicationListener{
private static final int cursorScaling = 1, outlineThickness = 3;
private static final Color outlineColor = Color.valueOf("444444");
private FreeTypeFontGenerator generator;
public MenuFragment menufrag;
@ -99,9 +96,9 @@ public class UI implements ApplicationListener{
/** Called from a static context to make the cursor appear immediately upon startup.*/
public static void loadSystemCursors(){
SystemCursor.arrow.set(Core.graphics.newCursor("cursor", cursorScaling, outlineColor, outlineThickness));
SystemCursor.hand.set(Core.graphics.newCursor("hand", cursorScaling, outlineColor, outlineThickness));
SystemCursor.ibeam.set(Core.graphics.newCursor("ibeam", cursorScaling, outlineColor, outlineThickness));
SystemCursor.arrow.set(Core.graphics.newCursor("cursor"));
SystemCursor.hand.set(Core.graphics.newCursor("hand"));
SystemCursor.ibeam.set(Core.graphics.newCursor("ibeam"));
Core.graphics.restoreCursor();
}
@ -126,8 +123,8 @@ public class UI implements ApplicationListener{
}
void loadExtraCursors(){
drillCursor = Core.graphics.newCursor("drill", cursorScaling, outlineColor, outlineThickness);
unloadCursor = Core.graphics.newCursor("unload", cursorScaling, outlineColor, outlineThickness);
drillCursor = Core.graphics.newCursor("drill");
unloadCursor = Core.graphics.newCursor("unload");
}
void generateFonts(Skin skin){

View file

@ -246,6 +246,15 @@ task swapColors(){
}
}
task antialiasImages(){
doLast{
for(def img : project.getProperty("images").split(",")){
println(project.getProperty("startdir") + "/" + img)
antialias(new File(project.getProperty("startdir") + "/" + img))
}
}
}
task scaleImages(){
doLast{
for(def img : project.getProperty("images").split(",")){