Code: Alles auswählen
;/ Folker Linstedt
;/ 2008-02-16
;/ PureBaic Textur-Contest
EnableExplicit
#TextureWidth=128 ; Möglich 32, 64, 128, 256, 512
CreateImage(0,#TextureWidth,#TextureWidth)
CreateImage(1,1024,1024)
Procedure ZeichneTextur(u,Drops=1)
;/ Optional
Protected i, i2, ix,k,f, R, G, B, x.f, y.f, RichtungX.f=1.2, RichtungY.f=0.7
ix=ImageWidth(0)
StartDrawing(ImageOutput(0))
;Box(0,0,128,128,RGB(255,128,0)) ;/ OHNE BOX gibt es in den hinteren Texturen abgerundete ECKEN, die durch den anschließenden Kreis herrühren
;/ QUELLCODE: Beispiel
For i=0 To 40
R=i
F=RGB(R,R/2,R/4)
Circle(64,64,80-i,F) ;/ Macht runde Ecke und löscht das Bild, wenn BOX fehlt
Next
x=10
y=40
While i<10000
i+1
x+RichtungX
y+RichtungY
; RichtungX-0.02
If y>(ix-1) Or y<1
RichtungY*(-1)
EndIf
If x>(ix-1) Or x<1
RichtungX*(-1)
EndIf
R=255-x
R+(i%56) ;/ Ausfranselfaktor
If R>255 ;/ OHNE Überprüfung franselt das rot links aus und es sieht aus wie FLAMMEN ;-)
R-2*(i%56)
EndIf
F=RGB(R,0,0) ; Rot wie blut
F=RGB(0,R/2,0) ;/ geht als GRAS durch ;-)
F=RGB(R*0.8,R/2.5,20) ;/ FARBE der Struktur, hier das Beispiel für KASTANIE ;-)
;
;F=RGB(40,128-R/2,R) ; Versuch mit blau/lila
If i%(U+1)=0
Circle(x,y,2,F)
Box(x,y,1,2,RGB(R/1.2,R/2,R/3.5))
EndIf
Wend
If Drops
For i=0 To 20
R=4*i
F=RGB(R,R,R)
Circle(64,64+i,22-i,F) ;/ Macht KLECKS in die Mitte
Next
EndIf
;/
StopDrawing()
EndProcedure
Procedure ZeichneTexturen()
Protected i, i2, a=1, k=0
For i2=0 To ImageHeight(1)/ImageHeight(0)-1
For i=0 To ImageWidth(1)/ImageWidth(0)-1
ZeichneTextur(a,i%2)
StartDrawing(ImageOutput(1))
DrawImage(ImageID(0),ImageWidth(0)*i,ImageHeight(0)*i2)
StopDrawing()
If k=1
a+1
k=-1
EndIf
k+1
Next
Next
EndProcedure
Procedure createGadgets()
ImageGadget(0,5,5,ImageWidth(0),ImageHeight(0),ImageID(0),#PB_Image_Border)
ScrollAreaGadget(1,GadgetX(0)+GadgetWidth(0)+5,5,WindowWidth(0)-GadgetWidth(0)-15,650,1124,1124,10)
ImageGadget(2,5,5,ImageWidth(1),ImageHeight(1),ImageID(1),#PB_Image_Border)
CloseGadgetList()
EndProcedure
If OpenWindow(0,0,0,1000,700,"FL Bild",#PB_Window_ScreenCentered | #PB_Window_SystemMenu) And CreateGadgetList(WindowID(0))
createGadgets()
ZeichneTextur(1)
ZeichneTexturen()
SetGadgetState(0,ImageID(0))
SetGadgetState(2,ImageID(1))
Define Event.l, Quit, GadgetNr
Repeat
Event=WaitWindowEvent()
If Event=16
Quit=1
ElseIf Event=#PB_Event_Gadget
GadgetNr=EventGadget()
EndIf
Until Quit
EndIf