Verfasst: 06.12.2006 15:45
jip. vorhin hat es geklappt. und die *.inf sind auch selbstsprechend.
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Es soll ja auch leicht sein die SpriteFont Lib mit neuen Bitmaps Fonts zu erweitern#NULL hat geschrieben:...und die *.inf sind auch selbstsprechend.
Code: Alles auswählen
ICE_DisplayVerticalSpriteText(y.l, x.l, s.s)
ICE_DisplayVerticalTransparentSpriteText(y.l, x.l, s.s)
Hallo Criss, wenn du keine Userlib mags, hast du bestimmt das ansprechen der Seriellen Schnittstelle im Pure-Source-Code.Leider mag ich keine Userlibs
Code: Alles auswählen
#Titler = "ICE_SpriteFont Library - DEMO -"
InitSprite()
InitSprite3D()
wX = 800
wY = 600
wHnd = OpenWindow(0, 0, 0, wX, wY, #Titler, #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(wHnd, 0, 0, wX, wY, 0, 0, 0)
SetFrameRate(99999)
LoadFont(1, "Arial", 10) ; Font Nr.: 1
LoadFont(2, "Papyrus", 30) ; Font Nr.: 2
LoadFont(3, "Rage", 40) ; Font Nr.: 3
LoadFont(4, "Script", 40) ; Font Nr.: 4
LoadFont(5, "Arial", 50) ; Font Nr.: 5
LoadFont(6, "Arial", 100) ; Font Nr.: 6
;###################################
;- Create the SpriteFonts
; ICE_CreateSpriteFont(FrontColor.l,BackgroundColor.l,Font Nr.)
;###################################
SpriteFont0 = ICE_CreateSpriteFont($FF, 0, -1) ; "Arial" Size: 10
SpriteFont1 = ICE_CreateSpriteFont($FF, 0, -1) ; "Arial" Size: 10
SpriteFont2 = ICE_CreateSpriteFont($FFFFFF, 0, 2) ; Papyrus Size: 30
SpriteFont3 = ICE_CreateSpriteFont($FF, $FFFF, 3) ; Rage Size: 40
SpriteFont4 = ICE_CreateSpriteFont($FF0000, 0, 4) ; Script Size: 40
SpriteFont5 = ICE_CreateSpriteFont($FF0000, 0, 5) ; Arial Size: 50
SpriteFont6 = ICE_CreateSpriteFont($FF0000, 0, 6) ; Arial Size: 100
;###################################
;- Create the SpriteFonts from an image file
; ICE_CreateSpriteFontFromImage(<Path of the image file>)
;###################################
SpriteFont7 = ICE_CreateSpriteFontFromImage(".\BitmapFonts\CoolSpot.bmp")
SpriteFont8 = ICE_CreateSpriteFontFromImage(".\BitmapFonts\094.bmp")
;###################################
;- Create the background picture
;###################################
sBox = CreateSprite(#PB_Any,wX,wY)
StartDrawing(SpriteOutput(sBox))
For n = 1 To wY
Box(0,n,100,1,$FFFF*n%255)
Box(100,n,100,1,$FFFF-n)
Box(200,n,100,1,$FF*n)
Box(300,n,100,1,n)
Box(600,n,100,1,$FF00FF*n)
Next n
Box(500,0,100,wY,$FF0000)
Box(400,0,100,wY,$FFFFFF)
StopDrawing()
x = 0
y = 0
xd = 1
yd = 1
id =1
Repeat
x +xd
y +yd
i +id
ClearScreen($0)
DisplaySprite(sBox,0,0)
event = WindowEvent()
Select event
Case #PB_Event_CloseWindow
CloseWindow(0)
End
EndSelect
; ;###################################
; ;- Set the actual SpriteFont
; ; ICE_DrawingSpriteFont(SpriteFontNr.l)
; ;###################################
; ICE_DrawingSpriteFont(SpriteFont1)
;
; ;###################################
; ;- Display a vertical transparent SpriteFont text
; ; ICE_DisplayVerticalTransparentSpriteText(x.l, y.l ,text.s)
; ;###################################
; ICE_DisplayVerticalTransparentSpriteText(350,x, "ICE_DisplayVerticalTransparentSpriteText")
;
; ICE_DrawingSpriteFont(SpriteFont0)
; ;###################################
; ;- Display a transparent SpriteFont text
; ; ICE_DisplayTransparentSpriteText(x.l, y.l ,text.s)
; ;###################################
; ICE_DisplayTransparentSpriteText(10, 10, "FPS: "+ Str(ICE_GetFPS()))
;
;
; s$ = "Position"
; ICE_DrawingSpriteFont(SpriteFont2)
; ICE_DisplayTransparentSpriteText(x,70, "(" + s$ + ") " +Str(x) + ", 70, ")
;
; ICE_DrawingSpriteFont(SpriteFont3)
; ICE_DisplayTransparentSpriteText(x,120, "(C) ICESOFT")
;
; ICE_DrawingSpriteFont(SpriteFont4)
; ICE_DisplayTransparentSpriteText(0, 170, "Test")
;
If i >= 255 Or i <= 0
id *-1
xxx = Random(wX)
yyy = Random(wY)
EndIf
If x > wX Or x < 0
xd *-1
EndIf
If y > wY Or y < 0
yd *-1
EndIf
angle+1
If angle > 359: angle = 0:EndIf
If Start3D()
ICE_DrawingSpriteFont(SpriteFont0)
ICE_DisplayFadingSprite3DText(10, 10, "FPS: "+ Str(ICE_GetFPS()),255)
s$ = "Position"
ICE_DrawingSpriteFont(SpriteFont2)
ICE_DisplayFadingSprite3DText(x,70, "(" + s$ + ") " +Str(x) + ", 70, ",255)
ICE_DrawingSpriteFont(SpriteFont3)
ICE_DisplayFadingSprite3DText(x,120, "(C) ICESOFT",255)
ICE_DrawingSpriteFont(SpriteFont4)
ICE_DisplayFadingSprite3DText(0, 170, "Test",255)
ICE_DrawingSpriteFont(SpriteFont6)
;###################################
;- Display a rotated SpriteFont text
; ICE_DisplayFadingSprite3DText(x.l, y.l, text.s, fading)
;###################################
ICE_DisplayFadingSprite3DText(200, 200,"FADING",i)
ICE_DrawingSpriteFont(SpriteFont8)
;###################################
;- Display a rotated SpriteFont text
; ICE_DisplayRotatedFadingSprite3DText(x.l, y.l, angle.l, text.s, fading.w)
;###################################
ICE_DisplayRotatedFadingSprite3DText(200, 200, angle, "ROTATE +",i)
ICE_DisplayRotatedFadingSprite3DText(200, 400,-angle, "ROTATE -",255-i)
ICE_DisplayRotatedFadingSprite3DText(y, x, angle, "ICESOFT",255)
ICE_DrawingSpriteFont(SpriteFont5)
ICE_DisplayFadingSprite3DText(xxx, yyy, "FADING ",255-i)
ICE_DrawingSpriteFont(SpriteFont7)
ICE_DisplayRotatedFadingSprite3DText(y, x, -angle, "ROTADE FADING",255)
ICE_DisplayRotatedFadingSprite3DText(x, y, -angle,Str(x),255)
ICE_DrawingSpriteFont(SpriteFont6)
ICE_DisplayRotatedFadingSprite3DText(wx/2-100, wy/2, angle, "RotA",255)
ICE_DisplayRotatedFadingSprite3DText(wx/2-200, wy/2, -angle, "RotA",255)
Stop3D()
EndIf
FlipBuffers(0)
Delay(1)
ForEver
End
Was mich mal interessieren würde:Dr. Shrek hat geschrieben:ICE_SpriteFont library zum Testen.
Aktuelle Version: 0.0.5
http://purebasic.myftp.org/?filename=fi ... ibDemo.zip
Zu 'Demo':Andre hat geschrieben: 1) Handelt es sich bei der Lib da jetzt nur um eine eingeschränkte Version oder sonstwie nicht frei verteilbare Version?
2) Wenn nicht, würde ich die ICE_SpriteFont nämlich gerne in die UserLibs auf www.PureArea.net aufnehmen, wenn Du nichts dagegen hast.