fb:porticula NoPaste
96teiliger Farbkreis, optimiert
Uploader: | Marc Bonus |
Datum/Zeit: | 16.09.2017 10:45:32 |
' Farbkreis-96-1.bas ' 96 teiliger Farbkreis, optimiert
#Include "fbgfx.bi"
Dim Shared As Single Grad,Winkel,D
DIm Shared As Integer x,y,Dreh,x1,y1,x2,y2,z,t,SWidth,SHeight
ScreenControl FB.GET_DESKTOP_SIZE, SWidth, SHeight ' Ermittele aktuelle Auflösung
IF SCREENRES(SWidth,SHeight,32,,FB.GFX_NO_FRAME or FB.GFX_ALPHA_PRIMITIVES) THEN
PRINT "Fehler: Grafikfenster konnte nicht initialisiert werden!"
SLEEP
END
END If
' Farbarray erstellen
Dim Farbkreis(11) As Integer
Farbkreis(0) = RGB(227,35,34) ' Rot
Farbkreis(1) = RGB(237,89,30) ' Rotorange
Farbkreis(2) = RGB(241,142,28) ' Orange
Farbkreis(3) = RGB(249,194,12) ' Gelborange
Farbkreis(4) = RGB(244,229,0) ' Gelb
Farbkreis(5) = RGB(145,221,46) ' Gelbgrün
Farbkreis(6) = RGB(0,188,37) ' Grün
Farbkreis(7) = RGB(26,168,114) ' Blaugrün
Farbkreis(8) = RGB(42,113,176) ' Blau
Farbkreis(9) = RGB(88,106,196) ' Blauviolett
Farbkreis(10) = RGB(146,80,191) ' Violett
Farbkreis(11) = RGB(219,4,147) ' Rotviolett
Declare Function GSin (Winkel AS Single) AS Single
Declare Function GCos (Winkel AS Single) AS Single
'
D = 2*3.14159265/360
Function GSin (Winkel AS Single) AS Single
Return -Sin((winkel+90)* D)
End Function
Function GCos (Winkel AS Single) AS Single
Return -Cos((winkel+90)* D)
End Function
Color RGB(0, 0, 0), RGB(0, 1, 1)
Cls
Dreh=170
x = SWidth/2
y = SHeight/2
Circle(x,y),500
grad=0+Dreh ' Felder
For z = 0 To 5
x1=x+GSin(Grad)*500
y1=y+GCos(Grad)*500
x2=x+GSin(Grad+180)*500
y2=y+GCos(Grad+180)*500
Line (x1,y1) - (x2,y2)
Grad=Grad+30
Next
grad=15+Dreh ' Farben
For z = 0 To 11
x1=x+GSin(Grad)*400
y1=y+GCos(Grad)*400
PAINT(x1,y1),Farbkreis(z),RGB(0,0,0)
Grad=Grad+30
Next
For t = 500 To 20 Step -60
Circle(x,y),t,RGB(0,0,1)
Next
For z = 0 To 3 ' helle Töne
Paint(x,y+z*60),RGBA(255,255,255,255-((z+1)*54)),RGB(0,0,1)
Next
For z = 5 To 8 ' dunkle Töne
Paint(x,y+z*60),RGBA(0,0,0,(z+1)*54),RGB(0,0,1)
Next
' Mittelkreis weiss
Circle(x,y),29,RGB(255,255,255),,,,F
Circle(x,y),30 ' Rand
Sleep
End