change text size?
- AutumnCheney
- Posts: 507
- Joined: Sun Dec 29, 2019 8:16 am
- Location: tahlequah, ok, usa
- Contact:
change text size?
i'm sure that this seems like a noob question, but is there any way i can change the text size with the print() function? i'm trying to work with larger screen sizes here and the default text size is too small
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: change text size?
There are at least two ways :)
1. Change pixel density for the whole window:
2. Use transformation:
1. Change pixel density for the whole window:
Code: Select all
set_pixel_size( WINDOW_XSIZE / DESIRED_WIDTH )
resize( get_screen(), WINDOW_XSIZE, WINDOW_YSIZE )
Code: Select all
$scale = 2
t_scale( $scale, $scale, $scale )
print( txt )
t_reset()
- AutumnCheney
- Posts: 507
- Joined: Sun Dec 29, 2019 8:16 am
- Location: tahlequah, ok, usa
- Contact:
Re: change text size?
oh wow, i had no idea about the t_reset() function! i'm guessing you would use that to transform things individually in pixilang?
tysm!!
tysm!!
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: change text size?
Here is the full list:
https://warmplace.ru/soft/pixilang/manu ... sformation
You can rotate/scale/translate the whole Pixilang coordinate system
https://warmplace.ru/soft/pixilang/manu ... sformation
You can rotate/scale/translate the whole Pixilang coordinate system
Re: change text size?
Hello,
I want to make the text bigger in the basic examples (like for_loop.pixi). I can't get either of the provided examples to change the size of text in the show_log.pixi file. The text is very tiny, and when using the included code, the text disappears.
I want to make the text bigger in the basic examples (like for_loop.pixi). I can't get either of the provided examples to change the size of text in the show_log.pixi file. The text is very tiny, and when using the included code, the text disappears.
Code: Select all
//Call this function to show the log on the screen:
fn show_log()
{
scr = get_screen()
xsize = get_xsize( scr )
ysize = get_ysize( scr )
hxsize = xsize div 2
hysize = ysize div 2
set_pixel_size( xsize / 2 )
resize( get_screen(), xsize , ysize )
$l = get_system_log()
clear()
print( $l, -hxsize, hysize, WHITE, BOTTOM | LEFT )
frame()
remove( $l )
while 1 //Wait for the EVT_QUIT event:
{
while( get_event() ) { if EVT[ EVT_TYPE ] == EVT_QUIT { halt } }
frame()
}
}
logf( "\n" )
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: change text size?
Use this code:
Code: Select all
fn show_log()
{
set_pixel_size( 2 )
resize( get_screen(), WINDOW_XSIZE, WINDOW_YSIZE )
scr = get_screen()
xsize = get_xsize( scr )
ysize = get_ysize( scr )
hxsize = xsize div 2
hysize = ysize div 2
$l = get_system_log()
clear()
print( $l, -hxsize, hysize, WHITE, BOTTOM | LEFT )
frame()
remove( $l )
while 1 //Wait for the EVT_QUIT event:
{
while( get_event() ) { if EVT[ EVT_TYPE ] == EVT_QUIT { halt } }
frame()
}
}