mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 19:15:14 -04:00
Fix scaling of all other default.png text.
This commit is contained in:
parent
a8cd79abcd
commit
3b5f676a7a
@ -229,20 +229,28 @@ namespace ClassicalSharp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void ReducePadding( ref Texture tex, int point ) {
|
public void ReducePadding( ref Texture tex, int point ) {
|
||||||
|
ReducePadding( ref tex, point, 4 );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReducePadding( ref int height, int point ) {
|
||||||
|
ReducePadding( ref height, point, 4 );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReducePadding( ref Texture tex, int point, int scale ) {
|
||||||
if( !UseBitmappedChat ) return;
|
if( !UseBitmappedChat ) return;
|
||||||
point = AdjTextSize( point );
|
point = AdjTextSize( point );
|
||||||
|
|
||||||
int padding = (tex.Height - point) / 4;
|
int padding = (tex.Height - point) / scale;
|
||||||
float vAdj = (float)padding / Utils.NextPowerOf2( tex.Height );
|
float vAdj = (float)padding / Utils.NextPowerOf2( tex.Height );
|
||||||
tex.V1 += vAdj; tex.V2 -= vAdj;
|
tex.V1 += vAdj; tex.V2 -= vAdj;
|
||||||
tex.Height -= padding * 2;
|
tex.Height -= padding * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReducePadding( ref int height, int point ) {
|
public void ReducePadding( ref int height, int point, int scale ) {
|
||||||
if( !UseBitmappedChat ) return;
|
if( !UseBitmappedChat ) return;
|
||||||
point = AdjTextSize( point );
|
point = AdjTextSize( point );
|
||||||
|
|
||||||
int padding = (height - point) / 4;
|
int padding = (height - point) / scale;
|
||||||
height -= padding * 2;
|
height -= padding * 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ namespace ClassicalSharp.Gui {
|
|||||||
|
|
||||||
public override void Init() {
|
public override void Init() {
|
||||||
font = new Font( game.FontName, 14 );
|
font = new Font( game.FontName, 14 );
|
||||||
posFont = new Font( game.FontName, 13, FontStyle.Italic );
|
posFont = new Font( game.FontName, 14, FontStyle.Italic );
|
||||||
game.Events.ChatFontChanged += ChatFontChanged;
|
game.Events.ChatFontChanged += ChatFontChanged;
|
||||||
|
|
||||||
fpsText = new ChatTextWidget( game, font );
|
fpsText = new ChatTextWidget( game, font );
|
||||||
|
@ -84,7 +84,8 @@ namespace ClassicalSharp.Gui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void Init() {
|
public override void Init() {
|
||||||
playerFont = new Font( game.FontName, 16 );
|
int size = game.Drawer2D.UseBitmappedChat ? 16 : 11;
|
||||||
|
playerFont = new Font( game.FontName, size );
|
||||||
chat = new ChatScreen( game );
|
chat = new ChatScreen( game );
|
||||||
chat.Init();
|
chat.Init();
|
||||||
hotbar = new BlockHotbarWidget( game );
|
hotbar = new BlockHotbarWidget( game );
|
||||||
|
@ -131,7 +131,7 @@ namespace ClassicalSharp.Gui {
|
|||||||
void AddPlayerInfo( PlayerInfo pInfo, int index ) {
|
void AddPlayerInfo( PlayerInfo pInfo, int index ) {
|
||||||
DrawTextArgs args = new DrawTextArgs( pInfo.ColouredName, font, false );
|
DrawTextArgs args = new DrawTextArgs( pInfo.ColouredName, font, false );
|
||||||
Texture tex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
|
Texture tex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
|
||||||
game.Drawer2D.ReducePadding( ref tex, Utils.Floor( font.Size ) );
|
game.Drawer2D.ReducePadding( ref tex, Utils.Floor( font.Size ), 3 );
|
||||||
|
|
||||||
if( index < 0 ) {
|
if( index < 0 ) {
|
||||||
info[namesCount] = pInfo;
|
info[namesCount] = pInfo;
|
||||||
|
@ -10,7 +10,7 @@ namespace ClassicalSharp.Gui {
|
|||||||
|
|
||||||
public ExtPlayerListWidget( Game game, Font font ) : base( game, font ) {
|
public ExtPlayerListWidget( Game game, Font font ) : base( game, font ) {
|
||||||
textures = new Texture[512];
|
textures = new Texture[512];
|
||||||
titleFont = new Font( game.FontName, 16, FontStyle.Underline );
|
titleFont = new Font( game.FontName, font.Size, FontStyle.Underline );
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerInfo[] info = new PlayerInfo[512];
|
PlayerInfo[] info = new PlayerInfo[512];
|
||||||
@ -119,7 +119,7 @@ namespace ClassicalSharp.Gui {
|
|||||||
void AddPlayerInfo( CpeListInfo player, int index ) {
|
void AddPlayerInfo( CpeListInfo player, int index ) {
|
||||||
DrawTextArgs args = new DrawTextArgs( player.ListName, font, true );
|
DrawTextArgs args = new DrawTextArgs( player.ListName, font, true );
|
||||||
Texture tex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
|
Texture tex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
|
||||||
game.Drawer2D.ReducePadding( ref tex, Utils.Floor( font.Size ) );
|
game.Drawer2D.ReducePadding( ref tex, Utils.Floor( font.Size ), 3 );
|
||||||
|
|
||||||
if( index < 0 ) {
|
if( index < 0 ) {
|
||||||
info[namesCount] = new PlayerInfo( player );
|
info[namesCount] = new PlayerInfo( player );
|
||||||
@ -164,7 +164,7 @@ namespace ClassicalSharp.Gui {
|
|||||||
void AddGroup( string group, ref int index ) {
|
void AddGroup( string group, ref int index ) {
|
||||||
DrawTextArgs args = new DrawTextArgs( group, titleFont, true );
|
DrawTextArgs args = new DrawTextArgs( group, titleFont, true );
|
||||||
Texture tex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
|
Texture tex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
|
||||||
game.Drawer2D.ReducePadding( ref tex, Utils.Floor( titleFont.Size ) );
|
game.Drawer2D.ReducePadding( ref tex, Utils.Floor( titleFont.Size ), 3 );
|
||||||
PlayerInfo pInfo = new PlayerInfo( group );
|
PlayerInfo pInfo = new PlayerInfo( group );
|
||||||
|
|
||||||
PushDown( info, index, pInfo );
|
PushDown( info, index, pInfo );
|
||||||
|
@ -65,7 +65,7 @@ namespace ClassicalSharp.Gui {
|
|||||||
void AddPlayerInfo( Player player ) {
|
void AddPlayerInfo( Player player ) {
|
||||||
DrawTextArgs args = new DrawTextArgs( player.DisplayName, font, true );
|
DrawTextArgs args = new DrawTextArgs( player.DisplayName, font, true );
|
||||||
Texture tex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
|
Texture tex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
|
||||||
game.Drawer2D.ReducePadding( ref tex, Utils.Floor( font.Size ) );
|
game.Drawer2D.ReducePadding( ref tex, Utils.Floor( font.Size ), 3 );
|
||||||
|
|
||||||
info[namesCount] = new PlayerInfo( player );
|
info[namesCount] = new PlayerInfo( player );
|
||||||
textures[namesCount] = tex;
|
textures[namesCount] = tex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user