Seite 2 von 2

Verfasst: 26.09.2006 18:54
von bobobo
sowas?

Code: Alles auswählen

;00005
; Version 13:11 27.09.2006
Procedure Startbedingungen()
EndProcedure
Procedure Initialisierung()
  InitMouse()
  InitSprite()
  InitKeyboard()
  InitSound()
  SetRefreshRate(75)
  UseJPEGImageDecoder()
  UseOGGSoundDecoder()
EndProcedure
Procedure Resourcen_laden()
  LoadSound(00001, "data\m00001.ogg")
  PlaySound(00001,1)
  LoadSound(00002, "data\mouseover.wav")
  LoadSound(00003, "data\mouseclick.wav")
  LoadFont (0, "Arial", 8)
  LoadImage(1,"data\00001.jpg")
  LoadSprite(1, "data\mouse.bmp")
  LoadSprite(2,"data\00002.bmp") ;verbinden
  LoadSprite(6,"data\00006.bmp") ;rahmen
  CreateSprite(7,491,33) ; Sprite für den Usernamen
  CreateSprite(8,491,33) ; Sprite für den Usernamen
EndProcedure
Procedure Fenster_zeichnen()
  OpenWindow(00002,1,1,640,480,"Optionen",#PB_Window_ScreenCentered|#PB_Window_Invisible)
  CreateGadgetList(WindowID(00002))
  ButtonGadget(00004,540,450,80,18,"Speichern")
  HideWindow(00002,1)
  OpenWindow(00003,1,1,640,480,"Updates",#PB_Window_ScreenCentered|#PB_Window_Invisible)
  CreateGadgetList(WindowID(00003))
  ButtonGadget(00005,540,450,80,18,"Speichern")
  HideWindow(00003,1)
  OpenWindow(00001, 0, 0, 800, 400, "(H)iveworx (C)lient (E)ngine", #PB_Window_ScreenCentered|#PB_Window_BorderLess)
  CreateGadgetList(WindowID(00001))
  OpenWindowedScreen(WindowID(00001),1,1,800,400,0,0,0)
EndProcedure
Procedure Mainloop()
  Repeat
    Event = WindowEvent()
    ExamineKeyboard()
    ExamineMouse()
    StartDrawing(ScreenOutput())
    DrawingMode(1)
    DrawImage(ImageID(1), 0, 0)
    FrontColor(RGB(200,200,200))
    DrawingFont(FontID(0))
    ;DrawText(10,10,""+Str(MouseX())) ;Debug Mouseoutput für X Koordinate
    ;DrawText(50,10,""+Str(MouseY())) ;Debug Mouseoutput für y Koordinate
    StopDrawing()
    ; Over Events
    
    If MouseX() > 597 And MouseX() < 740 And MouseY() > 366 And MouseY() < 385  ;Beenden Button
      If OverEND = 0
        PlaySound(00002,0)
        OverEND = 1
      EndIf
      TransparentSpriteColor(2, RGB(255,0,255))
      DisplayTransparentSprite(2, 594, 365)
    Else
      OverEND =0
    EndIf
    
    If MouseX() > 597 And MouseX() < 740 And MouseY() > 316 And MouseY() < 333  ;Verbinden Button
      If OverCON = 0
        PlaySound(00002,0)
        OverCON = 1
      EndIf
      TransparentSpriteColor(2, RGB(255,0,255))
      DisplayTransparentSprite(2, 594, 315)
    Else
      OverCON =0
    EndIf
    
    If (MouseX() > 257 And MouseX() < 742 And MouseY() > 245 And MouseY() < 270 And clickedpass=0)  Or Clickeduser=1;Username Feld
      If OverUSR = 0
        PlaySound(00002,0)
        OverUSR = 1
      EndIf
      TransparentSpriteColor(6, RGB(255,0,255))
      DisplayTransparentSprite(6, 253, 240)
    Else
      OverUSR=0
    EndIf
    
    If (MouseX() > 257 And MouseX() < 742 And MouseY() > 280 And MouseY() < 303 And clickeduser=0) Or clickedpass=1  ;Password Feld
      If OverPWD = 0
        PlaySound(00002,0)
        OverPWD = 1
      EndIf
      TransparentSpriteColor(6, RGB(255,0,255))
      DisplayTransparentSprite(6, 253, 276)
    Else
      OverPWD = 0
    EndIf
    
    ; Klick Events
    If MouseX() > 597 And MouseX() < 740 And MouseY() > 366 And MouseY() < 385 And MouseButton(1) ;Beenden Button
      clickeduser=0
      clickedpass=0
      If KlickEND = 0
        PlaySound(00003,0)
        KlickEND = 1
      EndIf
      Delay(300)
      End
    Else
      KlickEND = 0
    EndIf
    
    If MouseX() > 597 And MouseX() < 740 And MouseY() > 316 And MouseY() < 333 And MouseButton(1) ;Verbinden Button
      clickeduser=0
      clickedpass=0
      If KlickCON = 0
        PlaySound(00003,0)
        KlickCON = 1
      EndIf
    Else
      KlickCON=0
    EndIf
    
    If MouseX() > 257 And MouseX() < 742 And MouseY() > 245 And MouseY() < 270 And MouseButton(1) ;Username Feld
      If KlickUSR = 0
        PlaySound(00003,0)
        clickeduser+1
        If clickeduser=1
          clickedpass=0
        EndIf
        
        If clickeduser=2
          clickeduser=0
        EndIf
        KlickUSR =1
      EndIf
    Else
      KlickUSR =0
    EndIf
    
    If MouseX() > 257 And MouseX() < 742 And MouseY() > 280 And MouseY() < 303 And MouseButton(1) ;Password Feld
      If KlickPAS =0
        PlaySound(00003,0)
        clickedpass+1
        If clickedpass=1
          clickeduser=0
        EndIf
        If clickedpass=2
          clickedpass=0
        EndIf
        KlickPAS =1
      EndIf
    Else
      KlickPAS=0
    EndIf
    
    If clickeduser=1
      ExamineKeyboard()
      Inputname$ + KeyboardInkey()
      If KeyboardReleased(#PB_Key_Back)
        Inputname$ = Left(Inputname$, Len(Inputname$)-1)
      EndIf
    EndIf
    
    If clickedpass=1
      ExamineKeyboard()
      Inputpass$ + KeyboardInkey()
      If KeyboardReleased(#PB_Key_Back)
        Inputpass$ = Left(Inputpass$, Len(Inputpass$)-1)
      EndIf
    EndIf
    
    TransparentSpriteColor(1, RGB(0,255,0))
    DisplayTransparentSprite(1, MouseX(), MouseY())
    CreateSprite(8,491,33) ; Sprite für den Usernamen
    StartDrawing(SpriteOutput(8))
    DrawingMode(#PB_2DDrawing_Transparent)
    FrontColor(RGB(0,128,255))
    
    If clickedpass=1
      fnp+1
      If fnp>10
        fnpp.s="|"
      Else
        fnpp.s=""
      EndIf
    EndIf
    
    If fnp>20 Or clickedpass=0
      fnp=0
      fnpp=""
    EndIf
    DrawText(10,10,Inputpass$+fnpp)
    StopDrawing()
    
    CreateSprite(7,491,33) ; Sprite für den Usernamen
    StartDrawing(SpriteOutput(7))
    DrawingMode(#PB_2DDrawing_Transparent)
    FrontColor(RGB(0,128,255))
    If clickeduser=1
      fip+1
      If fip>10
        fipp.s="|"
      Else
        fipp.s=""
      EndIf
    EndIf
    If fip >20 Or clickeduser=0
      fip=0
      fipp=""
    EndIf
    DrawText(10,10,Inputname$+fipp)
    StopDrawing()
    DisplayTransparentSprite(7,253,240)
    DisplayTransparentSprite(8,253,276)
    FlipBuffers(0)
  Until KeyboardPushed(#PB_Key_Escape)
  End
EndProcedure
Startbedingungen()
Initialisierung()
Fenster_zeichnen()
Resourcen_laden()
Mainloop()

Verfasst: 27.09.2006 13:58
von smateja
wow, sehr geil und merci - paßt 1A - jetzt brauch ich glaub noch knapp ne woche zeit und ich habs verstanden *G - meric nochmal an dieser stelle