UnderwareDESIGN

PlayBASIC => Resources => Source Codes => Topic started by: kevin on December 05, 2006, 10:00:15 AM

Title: Fx Fonts
Post by: kevin on December 05, 2006, 10:00:15 AM
 Fonts now have a FX buffer support.  


  Note: With the Addition of Compressed Raster Fonts, both Bitmap & FX Bitmap font modes are basically obsolete.

  See: Fonts in PlayBASIC Help Files (https://playbasic.com/help.php?page=FONTS.INDEX)


Title: Re: Fx Fonts
Post by: kevin on January 03, 2007, 05:15:54 AM
The Code from this example

[pbcode]
; Display a message while the loads and are converted
Print "Loading Fonts:"
sync
screenvsync on

; Load the Windows True Type Font Arial (50 point)
LoadFont "Arial",2,60,1
PrepareFXfont 2
Setfont 2


; Create an Image in FX format (800*600)
CreateFXImage 1,800,600




Do
   ; Clear the screen
   Cls rgb(0,100,40)
   
   ; Tell PB to render to this surface
      rendertoimage 1

      ; Draw Box with Alpha Sub to the FX image
      inkmode 1+128
      boxc 0,0,800,600,true,rgb($2,$4,6)
      inkmode 1

      ; Render some text to this image in a random position
      text rnd(800),rnd(600),"FX Font On FX IMage"
   
    ; tell PB to direct all drawing to the screem
       Rendertoscreen

      ; Rotate our FX image and draw it to the screen
       DrawRotatedImage  1,400,300,angle#,1.0+Cos(angle2#),1.2,Getimagewidth(1)/-2,GetImageHeight(1)/-2,true

      ; draw the
      Print "Drawing FX fonts to FX images"
      Print Fps()      

      ; Bump the Rotation angles
      Angle2#=wrapangle(angle2#,2.1)
      Angle#=wrapangle(angle#,cos(angle2#)*1 )
   Sync
loop



[/pbcode]