Try my new website:
www.urcho.com
- the new SIMPLE social network
Sign up
|
287
members |
114
snippets
Search for:
ALL
POPULAR
File Controls
Multiplayer Code
2D Effects
3D Effects
Oldskool demos
Basic Functions
Maths/Physics
Sound
Tutorials
Misc
Username:
Password:
Sign up
Bal lens
[
back
]
Author:
Nebula
| Viewed:
807
times | Language:
BlitzPlus
| Category:
2D Effects
Function lensbal(x,y,w#,kstijl = False,kwaarde# = 255) ; x = horizontale lokatie op het scherm. ; y = vertikale lokatie op het scherm. ; w = breedte en hoogte van gevulde cirkel. ; kstijl = grijs(0),rood(1),groen(2),blauw(3) ; default(0) ; kwaarde = kleur waarde. 255 maximaal / 0 minimaal . ; Local final = CreateImage(w,w) Local a#,b#,c# ; If kwaarde > 255 Then kwaarde = 255 If kwaarde < 0 Then kwaarde = 0 If kstijl < 0 Then kstijl = 0 If kstijl > 3 Then kstijl = 0 ; For x1=0 To w-2 tip = CreateImage(w-x1,w-x1) SetBuffer ImageBuffer(tip) Select kstijl Case 1 ; rood a = (kwaarde/w*x1) : b = 0 : c = 0 Case 2 ; groen a = 0 : b = (kwaarde/w*x1) : c = 0 Case 3 ; blauw a = 0 : b = 0 : c = (kwaarde/w*x1) Default ; grijs a = (kwaarde/w*x1) : b = a : c = a End Select Color a,b,c Oval 0,0,w - x1,w - x1,True SetBuffer ImageBuffer(final) MidHandle tip DrawImage tip,w/2,w/2 FreeImage tip Next SetBuffer BackBuffer() DrawImage final,x,y End Function
Author Comments:
2D Ball lens effects
Login or
create an account
to comment on this snippet