|
@@ -11,10 +11,17 @@ Namespace myapp
|
|
|
#Import "<std>"
|
|
|
#Import "<mojo>"
|
|
|
|
|
|
+'simple image font
|
|
|
#Import "gnsh-bitmapfont-colour1.png"
|
|
|
+
|
|
|
+'monochrome angel font
|
|
|
#Import "testfont.fnt"
|
|
|
#Import "testfont_0.png"
|
|
|
|
|
|
+'fullcolor angel font
|
|
|
+#Import "coolfont.fnt"
|
|
|
+#Import "coolfont.png"
|
|
|
+
|
|
|
Using std..
|
|
|
Using mojo..
|
|
|
|
|
@@ -24,11 +31,17 @@ Class MyWindow Extends Window
|
|
|
|
|
|
Super.New( title,width,height,flags )
|
|
|
|
|
|
- Local image:=Image.Load( "asset::testfont_0.png" )
|
|
|
- Assert( image )
|
|
|
+ 'Example of loading a ttf font directly
|
|
|
+' Style.Font=FreeTypeFont.Load( "asset::fonts/DejaVuSans.ttf",32 )
|
|
|
|
|
|
- Style.Font=ImageFont.Load( "asset::gnsh-bitmapfont-colour1.png",5,12 )
|
|
|
+ 'Example of loading a simple image font where chars are 5x12
|
|
|
+' Style.Font=ImageFont.Load( "asset::gnsh-bitmapfont-colour1.png",15,36 )
|
|
|
+
|
|
|
+ 'Example of loading a monochrome angel font
|
|
|
' Style.Font=AngelFont.Load( "asset::testfont.fnt" )
|
|
|
+
|
|
|
+ 'Example of loading a fullcolor angel font
|
|
|
+ Style.Font=AngelFont.Load( "asset::coolfont.fnt" )
|
|
|
|
|
|
ClearColor=Color.Blue 'so we can see nice drop shadow.
|
|
|
End
|
|
@@ -37,8 +50,6 @@ Class MyWindow Extends Window
|
|
|
|
|
|
App.RequestRender()
|
|
|
|
|
|
- canvas.Scale( New Vec2f( 2.5,2.5 ) )
|
|
|
-
|
|
|
canvas.DrawText( "The Quick Brown Fox Jumps Over The Lazy Dog",0,0 )
|
|
|
End
|
|
|
|