Problem:
Ich habe ein kleines Prg. geschrieben und da werden Teile des Bildschirms immer aktualisiert (überdeckt), nur nach jeder aktualisierung Flackert einmal der Bildschirm auf. Ich denke mal das hat was mit den Flipbuffers zu tun , oder proge ich ganz falsch, mit Clearscreen bekomme ich es überhaupt nicht mehr unter Kontrolle.
hier das Prog.. (nicht lachen!

Mit den F-Tasten (F3,F4) soll der balken erhöt oder gesenkt werden, drückt mal drauf wie das Flackert, dabei aktualisiere ich doch immer nur das Rechteck und nicht den ganzen Bildschirm ???
Über jede Anregung oder idee bin ich sehr dankbar.
Code: Alles auswählen
InitSprite()
InitKeyboard()
InitMouse()
;- Bildschirmeinstellungen
OpenScreen(800, 600, 32, "Test")
ClearScreen(0,0,0)
#Speed = 0
;- Initsialisierung
LoadFont (0, "Courier New", 40,#PB_Font_Bold)
LoadFont (1, "Courier New", 14,#PB_Font_Bold)
;-Start
Gosub Startbildschirm
;-Tastatur
Repeat
ExamineKeyboard()
If KeyboardPushed(#PB_Key_F10): Gosub Balken: EndIf
Until KeyboardPushed(#PB_Key_Escape)
End
;--------------------------------------------------------------------------------------------------------------------------
;- Balken
Balken:
FlipBuffers()
StartDrawing(ScreenOutput())
DrawingMode(1)
FrontColor(0, 0, 0): Box (3,3,793,593)
FrontColor(255,255,255): Box (97,97,606,106)
FrontColor(0,0,0): Box (100,100,600,100)
FrontColor(0,255,0):
DrawingFont(UseFont(1))
Locate (120,220): DrawText("Speed % = 000")
Locate (170,500): DrawText("ESC = Zurück")
Locate (170,300): DrawText("F3 = -")
Locate (170,330): DrawText("F4 = +")
StopDrawing()
FlipBuffers()
Repeat
ExamineKeyboard()
If KeyboardPushed(#PB_Key_F3): Gosub Minus: EndIf
If KeyboardPushed(#PB_Key_F4): Gosub Plus: EndIf
Until KeyboardPushed(#PB_Key_Escape)
Return
;- Minus
Minus:
Speed = Speed - 1
If Speed <1 : Speed = 1: EndIf
L = Speed * 6
Gosub Anzeige
Return
;- Plus
Plus:
Speed = Speed +1
If Speed >100 : Speed = 100: EndIf
L = Speed * 6
Gosub Anzeige
Return
;- Anzeige
Anzeige:
FlipBuffers()
StartDrawing(ScreenOutput())
FrontColor(0,0,0): Box (100,100,600,100)
Box (120,220,200,20)
FrontColor(0,0,255): Box (100,100,L,100)
FrontColor(0,255,0):
DrawingMode(1)
DrawingFont(UseFont(1))
Locate (120,220): DrawText("Speed % = "+Str(Speed))
StopDrawing()
FlipBuffers()
Return
;- Startbildschirm
Startbildschirm:
StartDrawing(ScreenOutput())
DrawingMode(1):DrawingFont(UseFont(0))
FrontColor(90, 0, 255): Box (0,0,799,599)
FrontColor(0, 0, 0): Box (3,3,793,593)
FrontColor(90, 0, 255)
Locate (170,180)
DrawText("Hauptbildschirm")
DrawingFont(UseFont(1))
Locate (170,250): DrawText("F10 = Speed")
Locate (170,280): DrawText("ESC = Zurück")
StopDrawing()
FlipBuffers()
Return
End