BCC #29

Übersicht Sonstiges Projekte

Gehe zu Seite Zurück  1, 2, 3 ... 10, 11, 12

Neue Antwort erstellen

Xaymar

ehemals "Cgamer"

BeitragSa, Sep 19, 2009 17:04
Antworten mit Zitat
Benutzer-Profile anzeigen
ja das ist möglich
https://www.blitzforum.de/foru...creensaver
und mehr in der forum suche
Warbseite

Chrise

BeitragSa, Sep 19, 2009 17:14
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich kann mir ja irgendwann mal Zeit nehmen das ganze Recourcen-sparender zu machen und auf Vollbild umzubauen. Aber erst muss ich noch was für MacReeg fertig machen.
Llama 1 Llama 2 Llama 3
Vielen Dank an Pummelie, der mir auf seinem Server einen Platz für LlamaNet bietet.
 

c64

BeitragSa, Sep 19, 2009 21:09
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi,

Leider habe ich es nicht mehr geschafft weiter an meiner Uhr zu schrauben.
Da es sich um eine ganz einfache Uhr handelt lasse ich Sie ausserhalb der Konkurenz laufen, die Exe habe ich ja schoneinmal hochgeladen hier noch der Source.

Es ist nix optimiert und eigentlich wollte ich die Methoden bzw. Funktionen noch mehr anpassen aber die Uhr läuft es sind auch nette Helferfunktionen bei die man nutzen kann für andere Dinge, vllt. hilft es ja dem einem oder anderem.

Code: [AUSKLAPPEN]

'//////////////////////////////////////////////////////////
'
' BCC#29
'
'
' Thema: Uhren
'
'
'//////////////////////////////////////////////////////////

Framework brl.glmax2d
Import Brl.Retro
Import Brl.timer
      
SuperStrict

AppTitle="CLOCK_01"

Graphics 300,300

Global DummyImage:TImage     =   CreateImage(1,1,dynamicimage)

Local     Map:TPixmap      =   LockImage (DummyImage)         
WritePixel (Map,0,0,$ffffffff )
UnlockImage DummyImage

SetImageHandle DummyImage,0,.5

Global drinktea:ttimer=CreateTimer(100)
Global myCLock:TClock = TCLOCK.Create()
SetClsColor 255,255,255

While Not KeyHit (key_escape) And Not AppTerminate()

   Cls
   myClock.Render ()
   Flip 1
   
WaitTimer(DrinkTea)

Wend

Type Tclock

   Field h         :Int      ..
      ,m         :Int      ..
      ,s         :Int      ..
      ,tms         :Int      ..
      ,tst         :String   ..
      ,ctm       :Int      ..
      ,crtm      :Int      ..
      ,oldtime      :Int      ..
      ,sekarowjump    :Float   ..
                                       
   Function Create:TCLOCK ()
   
         Local NClock:TClock = New TClock
             NClock.crtm   = MilliSecs()
         
         
         Return NCLOCK
            
   EndFunction    

   Method SetTime (timeString:String)
   
         
   EndMethod

   Method Render()

      
         Local ctime   :Int   = time2milli(CurrentTime())
         Local timeh    :Int   = ctime/  3600000 Mod 12
         Local timem    :Int   = ctime/    60000 Mod 60
         Local times    :Int   = ctime/     1000 Mod 60
         
                  If sekarowjump <>0 sekarowjump:*.9
      If oldtime <> ctime oldtime=ctime sekarowjump=Rnd(1,1.6)                                    
         
      timeh=360/12*timeh
      timeh:-90
             SetColor 10,10,10
      drawArrow GraphicsWidth()/2,GraphicsHeight()/2,100,timeh   ,8
      drawArrow GraphicsWidth()/2,GraphicsHeight()/2,33,180+timeh ,20

      timem=360/60*timem
      timem:-90
             SetColor 10,100,10
      drawArrow GraphicsWidth()/2,GraphicsHeight()/2,140,timem   ,5

                     
SetTransform

          SetColor 10,10,10
               DrawOval (GraphicsWidth()/2)-28,(GraphicsHeight()/2)-28,56,56


          SetColor 10,100,10
               DrawOval (GraphicsWidth()/2)-24,(GraphicsHeight()/2)-24,48,48

      drawArrow GraphicsWidth()/2,GraphicsHeight()/2,48,180+timem ,10
SetTransform

          SetColor 200,10,10               
               DrawOval (GraphicsWidth()/2)-20,(GraphicsHeight()/2)-20,40,40

          SetColor 255,255,255               
               DrawOval (GraphicsWidth()/2)-15,(GraphicsHeight()/2)-15,30,30


          SetColor 200,10,10               
               DrawOval (GraphicsWidth()/2)-8,(GraphicsHeight()/2)-8,16,16

      times=360/60*times
        times:+sekarowjump*2

      times:-90
          SetColor 200,10,10               
      drawArrow GraphicsWidth()/2,GraphicsHeight()/2,150,times   ,3
      drawArrow GraphicsWidth()/2,GraphicsHeight()/2,42,180+times ,6         


         EndMethod

   Method DrawArrow(x:Int,y:Int,s:Float,Pos:Int,w:Float=4)

          SetTransform  pos,s,w
          SetBlend    Solidblend
          DrawImage   DummyImage,x,y

   EndMethod

   '-------------------------------------------------
   

   Function milli2time:String (Milli:Int)
      
   Local Ch:Int=milli/  3600000 Mod 24 ..
       , Cm:Int=milli/    60000 Mod 60 ..
       , cs:Int=milli/     1000 Mod 60 ..

   Local  ts:String = Replace ( RSet  ( String(ch),2) ," ","0")
        ts:+":"
        ts:+         Replace ( RSet ( String(cm),2) ," ","0")
        ts:+":"
        ts:+         Replace ( RSet ( String(cs),2) ," ","0")

   Return ts

   End Function
   
   Function time2milli:Int(time:String)

      Local  milli:Int     = (Int(Mid(CurrentTime(),1,2))*3600000)
           milli       :+ (Int(Mid(CurrentTime(),4,2))*60000)
           milli       :+ (Int(Mid(CurrentTime(),7,2))*1000)

      Return milli

   End Function
         
EndType



mfg. C64
Betreten verboten! Kinder haften für ihre Eltern!

Gehe zu Seite Zurück  1, 2, 3 ... 10, 11, 12

Neue Antwort erstellen


Übersicht Sonstiges Projekte

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group