v0.3.4c: removed font zoom cap

This commit is contained in:
Evan Debenham 2016-03-02 20:50:52 -05:00
parent 8ae4cd4fa5
commit 52b69b50e4

View File

@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner; import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.glwrap.Texture; import com.watabou.glwrap.Texture;
import com.watabou.input.Touchscreen; import com.watabou.input.Touchscreen;
import com.watabou.noosa.BitmapText; import com.watabou.noosa.BitmapText;
@ -60,8 +59,6 @@ public class PixelScene extends Scene {
public static Camera uiCamera; public static Camera uiCamera;
public static Class<?extends Window> windowOnCreate;
//stylized pixel font //stylized pixel font
public static BitmapText.Font pixelFont; public static BitmapText.Font pixelFont;
//These represent various mipmaps of the same font //These represent various mipmaps of the same font
@ -198,11 +195,8 @@ public class PixelScene extends Scene {
} }
public static RenderedText renderText( String text, int size ) { public static RenderedText renderText( String text, int size ) {
//rendering above 6x is a waste of resources, can just scale from there. RenderedText result = new RenderedText( text, size*defaultZoom);
int zoom = Math.min(defaultZoom, 6); result.scale.set(1/(float)defaultZoom);
RenderedText result = new RenderedText( text, size*zoom);
//adding 0.001f helps with smoothness on lower resolution devices.
result.scale.set(1/(float)zoom);
return result; return result;
} }
@ -211,9 +205,8 @@ public class PixelScene extends Scene {
} }
public static RenderedTextMultiline renderMultiline( String text, int size ){ public static RenderedTextMultiline renderMultiline( String text, int size ){
int zoom = Math.min(defaultZoom, 6); RenderedTextMultiline result = new RenderedTextMultiline( text, size*defaultZoom);
RenderedTextMultiline result = new RenderedTextMultiline( text, size*zoom); result.zoom(1/(float)defaultZoom);
result.zoom(1/(float)zoom);
return result; return result;
} }