User loginNavigation |
Tutorial Two - Measure Disk SpaceFor this tutorial and a few others I will just go over how to add differnt types measures/meters. For this tutorial we will add in how to measure your hard drive space and display it. To begin lets add in a simple background to put text ontop of.
If you'll notice, at the bottom of the code is a new entry that wasn't explained in the previous tutorial. Update works to keep your meters up to date or in case of animation will be the framerate for it. As stated in the helpfile the value should be given in milliseconds. 1000 = 1 second. Now Lets add our measure of the drive
of course at the beginning I added a divider to keep things neat. Typically you should keep all your measures within the same divided area. Next I named the measure as MeasureDiskC. To keep things simple Adding Measure before what you're measuring is a good way to keep things organized. After that we add in what we're measuring. FreeDiskSpace. Note the capital letters as you should keep these the same. Next enter is Drive= Here we add in what drive you want to be measured. In this case I chose the C drive but you can enter what drive letter you want measured here. Since we've now set up rainmeter to measure the Drive C we can now create a meter that will display the information.
Again I seperate this with a comment line. Next we name the Meter as MeterDiskC. The Meter type is STRING. As before note the capitals. MeasureName asks for the name of the measure that is linked to this meter, in this case it's MeasureDiskC. Next we set the Position of the meter display with X and Y. AutoScale is set to 1. Honestly I don't understand this option very much. In the help file it's written as . . . AutoScale All I can tell you is that if it's not there or set to 0 it will give you a very long negative number which isn't what you will want. Now if you save this and use this meter you should get a color background with text on it that displays how much freespace you have remaining on your C drive. Now to play with some options. Well how about if we want to display which drive it is? Lets add in text above the readout. So Between the ;--- comment line and the Meter add in this
By now this should be a fairly easy one to figure out. I named it . . and the Meter type is STRING. Then you can add in your position and lastly You specifiy what Text is to be displayed. In this case I want C:\ to be displayed. Okay now on the Meter that should be under this that displays the diskspace you'll need to change the position some or else you will see these two displayed on top of each other. So just change the Y to 15r. When you put an r is signifys that it's relative to the previous Meter that was placed. What this means is that this meter will be placed 15 pixels below the other meter. using the r method is a great way to make nice spacing between your meters. Like if you need to reposition the whole you can just move one meter and all those that are relative to it will move also. Okay now save and you'll see The drive text C:\ displayed with your freespace under it for drive C. Okay lets try a different method.
Now I've changed the Text to display FreeSpace and added a new entry on MeterDiskC called Prefix. This will display what ever text you enter before your measure information. Also I added in quotation marks because I wanted some spaces after the C:\. If you don't care about your measure information being displayed right against your prefix you don't need quotes. Okay Lets move on. This part is rather simple in a sense. We're now going to add the total drive size. First off go to the measure [MeasureDiskC] and copy the entire thing . . add a space and post a copy of it under. Change the name to [MeasureDiskCTotal] and at the very end of it add a new line that says Total=1. What this will do is instead show the total space contained on the drive instead. Now we want to display this information. Repeat the same process and copy both meters and post a copy of them under the first 2 meters created. Now just add Total to the names. Change the 2nd Text to DriveSize and give it a Y=15r position. It should appear as this now:
Okay next lets add the title of the drive to the mix. Copy [MeasureDiskC] again and this time name it [MeasureDiskCName]. Now at the bottom of it add in a new line that says Label=1. What this does is Takes the name of the Drive and displays it. Now we need to create a measure that displays this so add this before all the other meters right under the ;--- seperator line.
Because this is now the 0,0 position with X and Y you should change the meter that used to be first to Y=15r. This will align it like all the rest. Isn't relative positioning great? :)Now save and display to see the name of the drive then under that Freespace . .the amount of freespace then Drivesize text and finally how big your drive is. Okay lets just add one more thing to this piece before ending this tutorial. Lets add in a bar to display the space. Add this after [MeterDiskC]
Since the Positioning of this small bar is different to keep your meters looking nicely arranged you'll have to change the Y position of [MeterDiskCTotaltext] under the bar meter to Y=5r. For this new Meter Of course we change the Meter name to be in line what it is. Next the Meter type is BAR . . since this bar is linked to the freespace we didn't have to create a new measure . . just link it to MeasureDiskC. This time we added a W= and H = to display how big we want this. I decided on HORIZONTAL bar under the freespace display But I could of easily made it Veritcal and placed it on the left side of all the text going upwards. BarColor is the RGB color display of how much freespace is being measured while SolidColor is the RGB color display of the background of the bar. In other words for this meter the DriveSize inidication. There are various other tricks to make your meters more graphically pleasing but this should give you the basics of how to create your first most common meter and measure. Since I've gone over the methods of adding in text and adding in a bar I'll only cover what to add in to create new measures and meters in the next few tutorials. Good Luck. ( categories: )
|