A Colorful Ball of Light Function
This code will allow you to make a ball of light of any size and color, ready to go in a module! Please vote.
AI
AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
源代码
Public Function MakeLight(frm As Form, originx As Integer, originy As Integer, radius As Integer, red As Integer, green As Integer, blue As Integer) For tiltx = -0.5 To 0.5 Step 0.5 ' offset it a tad to get the pixels not colored For tilty = -0.5 To 0.5 Step 0.5 ' offset it a tad to get the pixels not colored For tempradius = 0 To radius Step 1 ' colors multiple circles with origins from the origin to origin + radius Randomize circlecolor = Int(Rnd * (1 * (radius / 255))) + (tempradius / (radius / 255)) + 1 ' gets a random color in a specific range, give it the light effect circlecolor = Abs(circlecolor - 255) ' inverts the colors from white outside to white inside frm.Circle (originx + tiltx, originy + tilty), tempradius, RGB(circlecolor + red, circlecolor + green, circlecolor + blue) ' makes the circle Next tempradius Next tilty Next tiltx End Function
原始评论 (3)
从 Wayback Machine 恢复