LoadFontDX9() benötigt die angabe eines Wertes für das Argument Weight! Leider ist bisher im HelpFile keine info dazu! (dieses wird geändert)! Daher poste ich mal ein kleines example, wie ihr den Weight Wert richtig benutzt!
Code: Alles auswählen
; /*************************************************************************************
; / Small Font Example by Mr.Vain of Secretly! (Thorsten Will) & Deeem2031
; / Demonstrating the using of SpriteDX9 v0.57+ by Deeem2031
; /
; / 05-September-2005 / Load Font and how to define the argument "weight" v0.1
; /*************************************************************************************
InitSpriteDX9()
InitKeyboard()
; -------- Run Windowed/FullScreen Mode? and Open DirectX9 Screen --------
lResult = MessageRequester("Please select:","Run example in FullScreen mode?",#PB_MessageRequester_YesNo)
If lResult = #PB_MessageRequester_No ; User pressed NoButton
lMode = #PB_D3D_Windowed|#PB_D3D_AlphaBlending|#PB_D3D_AntiAliasing4
hScreen = OpenScreenDX9(800,600,32,OpenWindow(0,0,0,800,600,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"SpriteDX9 Example"),lMode)
Else ; User pressed YesButton
lMode = #PB_D3D_AntiAliasing4 |#PB_D3D_AlphaBlending
hScreen = OpenScreenDX9(800,600,32,"SpriteDX9 Example",lMode)
EndIf
If hScreen = 0
MessageRequester("Error","Cant open DirectX9 Screen",0)
End
EndIf
; -------- Load Fonts and define ints weitgh --------
#FW_THIN = 100
#FW_NORMAL = 400
#FW_BOLD = 700
#FW_HEAVY = 900
hFont0 = LoadFontDX9("Arial", 64, 40, #FW_THIN)
hFont1 = LoadFontDX9("Arial", 64, 40, #FW_NORMAL)
hFont2 = LoadFontDX9("Arial", 64, 40, #FW_BOLD)
hFont3 = LoadFontDX9("Arial", 64, 40, #FW_HEAVY)
; -------- MainLoop --------
Repeat
ClearScreenDX9(RGBA(0,0,100,0))
StartDX9()
DrawTextDX9(hFont0,"DrawText Thin" ,20, 20,800,600,RGBA($FF,$FF,$FF,$FF))
DrawTextDX9(hFont1,"DrawText Normal",20,120,800,600,RGBA($FF,$FF,$FF,$FF))
DrawTextDX9(hFont2,"DrawText Bold" ,20,220,800,600,RGBA($FF,$FF,$FF,$FF))
DrawTextDX9(hFont3,"DrawText Heavy" ,20,320,800,600,RGBA($FF,$FF,$FF,$FF))
StopDX9()
FlipBuffersDX9()
DisableDebugger
; -------- Check Window Events --------
lEvent.l = WindowEvent()
While lEvent
If lEvent = #PB_Event_CloseWindow
wQuit.w = 1
EndIf
lEvent = WindowEvent()
Wend
; -------- Check if ESCAPE pressed --------
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape) Or wQuit
EnableDebugger
; -------- Quit and free all Stuff --------
FreeFontDX9(hFont0)
FreeFontDX9(hFont1)
FreeFontDX9(hFont2)
FreeFontDX9(hFont3)
CloseScreenDX9()
End
; /EOL
; /**************************************************************************
