Drawrect

From Scriptwiki
Jump to: navigation, search

/drawrect -ihnrfecd @ <color> <size> <x y w h> [<x y w h>...]

Draws a rectangle at the specified co-ordinates of the specified width and height. If more co-ordinates are specified these are also drawn as separate rectangles.

Switches

-i draws in inverse mode.
-h highlights the windows icon if it is minimized.
-n prevents the display from being updated immediately. This allows you to make changes to the window in the background and then display the results only when you have finished. You can update the display by using any of the /draw commands with only the window name specified.
-r indicates that the color is in RGB format. You can use $rgb(N,N,N) to create an RGB value.
-f fills the rectangle with the current color.
-e draws an Ellipse instead of a rectangle. You can draw a filled ellipse if you also specify the -f switch.
-c draws a focus rectangle.
-d draws a rounded rectangle, using the format /drawrect -d x y w h [w h],  where w and h are the width and height of the ellipse used to draw the corners.


Examples:

/drawrect -h @drawingboard 4 3 15 15 50 50

Draws a rectange in the window @drawingboard with linewidth of 3 pixels, top-left corner starts at x=15,y=15 and gives the rectangle height of 50 and width of 50.

/drawrect -d @drawingboard 4 3 15 15 100 100 15 15

Draws same kinda rectangle as previously, except this one is 100*100 in size, and -d switch make it use the last 2 parameters for rounding it by 15*15 pixels.

The whole window can be cleared by using the /clear command, eg. /clear @name. You can also specify the -n switch in /clear to delay the effect as described above.

See Also

  • $rgb for the use of RGB colors with this identifier.