Hallo,
da es einige gibt die nur mit B+ arbeiten und es gestört hat das Print usw nicht im Grafik Fenster möglich ist, habe ich die mal neu geschrieben!
Jetzt geht auch Locate wieder!
Ist natürlich mehr für Beginner gedacht! BlitzBasic: [AUSKLAPPEN] [EINKLAPPEN]
Global PrintWriteX% Global PrintWriteY% Global Textheight% Global BackImg% = CreateImage (GraphicsWidth () ,GraphicsHeight () )
Function Locate (x%,y%) PrintWriteX = X PrintWriteY = y End Function
Function Print (A$ = \"\") print_Change_sys () Text PrintWriteX,PrintWriteY,A$ Flip 0 If Textheight < FontHeight () Then Textheight = FontHeight () PrintWriteY = PrintWriteY + Textheight Textheight = 0 PrintWriteX = 0 End Function
Function Write (A$) print_Change_sys () Text PrintWriteX,PrintWriteY,A$ Flip 0 PrintWriteX = PrintWriteX + StringWidth (A$) If Textheight < FontHeight () Then Textheight = FontHeight () End Function
Function print_Change_sys () Flip 0 CopyRect 0 ,0,GraphicsWidth () ,GraphicsHeight () ,0,0,BackBuffer () ,ImageBuffer (BackImg) Flip 0 If PrintWriteY + FontHeight () > GraphicsHeight () Then Cls DrawBlock BackImg,0,GraphicsHeight () - PrintWriteY - FontHeight () PrintWriteY = GraphicsHeight () - FontHeight () Else DrawBlock BackImg,0,0 End If End Function
Function Input$ (A$ = \"\") A$ = A$ + \" \" print_Change_sys () If PrintWriteY + FontHeight () => GraphicsHeight () Then CopyRect 0 ,0,GraphicsWidth () ,GraphicsHeight () ,0,0,BackBuffer () ,ImageBuffer (BackImg) End If Repeat DrawBlock BackImg,0,0 zz = GetKeyNew () If zz > 31 And zz < 256 Then antwort$ = antwort$ + Chr (zz) If zz = 8 Then If Len (antwort$) > 0 Then antwort$ = Left (antwort$, (Len (antwort$) - 1) ) End If End If If CursorStatus Then Text PrintWriteX,PrintWriteY,a$ + antwort$ + Chr(95) Else Text PrintWriteX,PrintWriteY,a$ + antwort$ End If If CursorZeit < MilliSecs () Then CursorStatus = CursorStatus Xor 1 CursorZeit = MilliSecs () + 300 End If If zz = 13 Then DrawBlock BackImg,0,0 Text PrintWriteX,PrintWriteY,a$ + antwort$ If Textheight < FontHeight () Then Textheight = FontHeight () PrintWriteY = PrintWriteY + Textheight Textheight = 0 PrintWriteX = 0 Flip 0 Return antwort$ End If Flip 0 Forever End Function
Function GetKeyNew () Local xx If KeyHit (181) xx = 47 ElseIf KeyHit (82) Then XX = 48 ElseIf KeyHit (83) Then XX = 44 ElseIf KeyHit (79) Then XX = 49 ElseIf KeyHit (80) Then XX = 50 ElseIf KeyHit (81) Then XX = 51 ElseIf KeyHit (75) Then XX = 52 ElseIf KeyHit (76) Then XX = 53 ElseIf KeyHit (77) Then XX = 54 ElseIf KeyHit (71) Then XX = 55 ElseIf KeyHit (72) Then XX = 56 ElseIf KeyHit (73) Then XX = 57 End If If xx = 0 Then XX = GetKey () FlushKeys () Return xx End Function
Ist natürlich nichts für schnelle Sachen!
Versucht es bitte nicht mit BB2D oder BB3D, es geht nicht!
Wenn der Fehler "Invalid Blitz2D Buffer handle"
dann fehlt der Graphics Befehl
|