Now it works on DBPRO
rem -------------------------------------------------------------------
rem program name: Useing Bitmap as text Version 0.002.000
rem -------------------------------------------------------------------
rem written by: Joseph Allen ( ALIEN )
rem date: 28/11/2006
rem -------------------------------------------------------------------
rem comments:
rem Add me to the credits it you use this snippet.
rem -------------------------------------------------------------------
SET DISPLAY MODE 640, 480, 16
sync rate 0 : sync on : hide mouse
cls 0
gosub _Veribles
rem Need to load an image
Load_Text_Bitmap( "Text 001.bmp" , 20 , 20 , 0 )
Load_Text_Bitmap( "Text 003.bmp" , 20 , 20 , 2 )
Load_Text_Bitmap( "Text 004.bmp" , 20 , 20 , 3 )
Load_Text_Bitmap( "Text 005.bmp" , 20 , 20 , 4 )
Load_Text_Bitmap( "Text 006.bmp" , 20 , 20 , 5 )
do
cls RGB(0,0,255)
rem Use this for drawing the text
Image_Text( "FPS: " + str$( screen fps() ) , 10 , 10 , Text_Colour , 1 , 20 )
Image_Text( "TIME: " + GET TIME$() , 300 , 10 , Text_Colour , 1 , 20 )
Image_Text( "PRESS 1-5 TO CHANGE TEXT COLOUR" , 10 , 50 , Text_Colour , 1 , 20 )
Image_Text( "1: WHITE" , 50 , 100 , 0 , 1 , 20 )
Image_Text( "2: ICE" , 50 , 150 , 3 , 1 , 20 )
Image_Text( "3: FIRE" , 50 , 200 , 2 , 1 , 20 )
Image_Text( "4: GRASS" , 50 , 250 , 4 , 1 , 20 )
Image_Text( "5: GRAY" , 50 , 300 , 5 , 1 , 20 )
IF inkey$() = "1" then Text_Colour = 0
IF inkey$() = "2" then Text_Colour = 3
IF inkey$() = "3" then Text_Colour = 2
IF inkey$() = "4" then Text_Colour = 4
IF inkey$() = "5" then Text_Colour = 5
sync
loop
_Veribles:
rem Need these verible for it to work
rem Start_Text_NUM(1) and Text_Bitmap(1) can be set to any number you like.
DIM Start_Text_NUM(1) : Start_Text_NUM(1) = 1000
Dim Text_Bitmap(1) : Text_Bitmap(1) = 60000
rem not need for the function to work
Text_Colour = 0
return
Function Load_Text_Bitmap( FIle_Name$ , Size_X , Size_Y , T_Num )
IF File exist( FIle_Name$ ) = 1
Load image FIle_Name$ , Text_Bitmap(1)
Bitmap_Width = 2 + ( 10 * ( Size_X + 1 ) ) : Bitmap_Height = 2 + ( 10 * ( Size_Y + 1 ) )
CREATE BITMAP 1 , Bitmap_Width , Bitmap_Height
set current bitmap 1
Paste image Text_Bitmap(1) , 0 , 0
Tile_Count = 1
FOR Y = 0 to 9
FOR X = 0 to 9
TEMP_X = 1 + ( x * ( Size_X + 1 ) ) : TEMP_Y = 1 + ( y * ( Size_Y + 1 ) )
Image_Number = Start_Text_NUM(1) + Tile_Count + ( T_Num * 100 )
GET IMAGE Image_Number , TEMP_X , TEMP_Y , TEMP_X + Size_X , TEMP_Y + Size_Y
Tile_Count = Tile_Count + 1
next X
NEXT Y
set current bitmap 0
delete bitmap 1
Delete image Text_Bitmap(1)
endif
endfunction
function Image_Text( Input_String$ , TEXT_X , TEXT_Y , T_Num , Tran , Size_X )
Text_Pos = TEXT_X
FOR N = 1 to len( Input_String$ )
TEMP_ASC = asC( MID$( Input_String$ , N ))
Image_Number = Start_Text_NUM(1) + (TEMP_ASC - 31 ) + ( T_Num * 100 )
IF Tran = 1
Paste image Image_Number , Text_Pos , TEXT_Y , 1
else
Paste image Image_Number , Text_Pos , TEXT_Y
endif
Text_Pos = Text_Pos + Size_X
NEXT N
endfunction
just removed absolete line
SET EMULATION ON
Thanx for the code m8
Yes www.darkbasic.se - swedish forum is comming