Weather applet - Copyright (C) by Anfy Team 2001-2002 This applet could generate fog, rain and lightnings effects on a background image or color. This applet contains code by Richard T. Elmore used under license. ************************************************************************ NECESSARY FILES. Apart from an optional background image and an optional overlay image, the following 3 ".class" files must be uploaded: weather.class Lware.class anfy.class Plus, weather.jar for speedy loading on recent browsers. ********************************************************************* EXAMPLE. Insert the tag in your html document as follows to add this applet to your page (Comments after the ";" symbol are code explanations and acceptable min/max values. They are not part of the applet language): ; Name, Width, Height. ; Credits line. ; Registration code (if you have it). ; Optional URL link when the applet is "clicked". ; Reglink opened in new frame ? ; Name of new frame for reglink. ; Statusbar message. ; Resolution (1-8). ; Background image. ; Background color. ; Fog effect ("yes","no") ; Fog intensity (1 .. 256) ; Fog min value allowed (0 .. 255) ; Fog max value allowed (0 .. 255) ; Fog multiplier (1 .. 512) ; Fog direction ("left","right","up","down") ; Fog speed. ; Fog interactive mode ("no","in","out") ; Rain effect ("yes","no") ; Rain transparency (0 .. 255) ; Rain drops number. ; Rain color 1. ; Rain color 2. ; Rain speed. ; Rain drops difference of speed ; Rain interactive mode ("no","in","out") ; Lightning effect on/off ("yes" or "no") ; Thunder sound or "no". ; Lightning strength value. ; Lightning min strength. ; Lightning max strength. ; Lightning max y reaching ; Lightning background max brightness (1..8) ; Lightning min direction change. ; Lightning max direction change. ; Lightning branches creation value. ; Lightnings min number each group. ; Lightnings max number each group. ; Lightning groups min delay. ; Lightning groups max delay. ; Optional image over applet. ; Over image X offset ; Over image Y offset ; Memory deallocation delay. ; Task priority (1..10). ; Min. milliseconds/frame for sync. Sorry, your browser doesn't support Java. ; Message for no java browsers. ********************************************************************* PARAMETER DESCRIPTIONS. The following instructions describe how to change parameters: Attempting to change the credit parameter will disable the applet. To activate the reg parameters read the shareware registration notes. In the "regcode" parameter, place the registration code you purchased from the author. If the code is correct and the applet is run from the registered domain name, you can use "link" parameters to link to a URL when the applet is "clicked". If you set "regnewframe" to "YES", you can specify a specific frame location for the reglink: "_blank" : To load the link in a new blank unnamed browser window. "_self" : To load the link into the same window the applet occupies. "_parent" : To load the link into the immediate FRAMESET parent. "_top" : To load the link into the top body of the window. You can also set a custom frame name, such as "myframe1". With the "overimg" parameter you can specify the name of an image that will be painted over the applet. The best options are transparent GIF images. NOTE: Animated GIF images are supported, but will be displayed as animated only on latest browsers (Netscape 4 and Explorer 4 or newer). With "overimgX" and "overimgY" you can center the image over the applet area. With the "statusmsg" parameter you can set a message which appear at the bottom of the browser window, when you mouse-over the applet. Applet size is determined by "res": "res=1" shows the graphic at original size, "res=2" shows it at double size, etc. So, If res=1, remember to place the exact size of image in "width" and "height" tags. If res=2, place double values, if res=3 place triple values etc. (In fact, res is a sort of zoomer). With the "bgimage" parameter, you can add an image to the applet's background. If you do not use a background image, you can choose a background color, with the "bgcolor" parameter (use a RRGGBB format). In this applet you can one or more weather conditions: Fog, Rain and Lightnings. ** Fog ** You can switch on/off the fog using the "fogon" parameter (use "yes" or "no" value). Use the "fogstrength" parameter to set the fog intensity (1 .. 256). Use "fogmin" and "fogmax" to determine the minimum and maximum fog values allowed (0 .. 255). For example, if you set fogmin=0 and fogmax=0, the fog could range from 0 (no fog) to 255 (fully white fog). If you increase the fogmin value, darker parts with no fog will become less frequent. If you decrease the fogmax, fully white fog parts will be less frequent. With the "fogmult" parameter (1 .. 512) you set the fog value multiplier. Lower values means less fog consistency, higher values will fill all the applet area with unified fog. The "fogdirection" parameter sets the fog direction ("left","right","up","down"). With "fogspeed" you decide the fog speed. With the "foginteraction" parameter, you can choose between three interactive modes: - "no" for no fog user interaction. - "in" the fog will start when the mouse pointer is over the applet area. - "out" the fog will stop when the mouse pointer is over the applet area. ** Rain ** You can switch on/off the rain effect using the "rainon" parameter ("yes" or "no"). Using the "rainstrength" parameter (1 .. 255) you choose the transparency of rain. Lower values will make the rain less visible and more transparent. Higher values will make the rain more visible and less transparent. With the "raindropsnumber" parameter you choose the falling drops number. With "raincolor1" and "raincolor2" you select the first and last color for the color range used to paint the rain drops. Specify the same color on the two parameters if you want all the drops to look identical. With "rainspeed", you select the rain speed (base value). With "raindifspeed" you select the rain drops difference of speed (difference of speed that drops may reach from base rain speed value). Using the "raininteraction" parameter, you can choose between three interactive modes: - "no" no user rain user interaction. - "in" the rain will start when the mouse pointer is over the applet area. - "out" the rain will stop when the mouse pointer is over the applet area. ** Lightnings ** You can switch on/off the lightning effect using the "lightningon" parameter ("yes","no"). If you want, you can set a sound for the thunders secifying an 8bit 8Khz mono .au file in the "lightningsound" parameter. Otherwise set it to "no". Using the "lightningstrength" parameter you can choose the average lightnings size. Additionally, use "lightningminstrenght" and "lightningmaxstrenght" to contain the lightnings size into a certain range. It could be useful for example to place these at high values to see lightnings very small and so very far. Lower values instead create bigger thunders which seems nearer. With the "lightningymax" parameter you decide the maximum y position reachable by the lightning, from top to bottom. This value may be imprecise if "branchvalue" is high because it does not include the branches which may go lower. With the "lightningbright" parameter (1..8) you set the max background flashing. With the "lmindirchange" parameter you set the minimim value for direction speed change. Higher values may give less curved and more vertical lightnings. With the "lmaxdirchange" parameter you set the maximum value for direction speed change. Lower values may give more curved and more horizontal lightnings. With the "lbranchvalue" parameter you set the branches frequency of lightnings. With the "lgrminnumber" and "lgrmaxnumber" parameters you decide the min and max number of lightnings for each lighnings group. With the "lgroupsmindelay" and "lgroupsmaxdelay" parameters you decide the min and max delay of time (with no lightnings) between each lighnings group.