Icons

There is no point in hiding it - the icons module is really awesome! Icons behave just like shapes, but there are 995 of them, as the module allows you to use any of the free Font Awesome icons.

To use the module you have to import it first by writing import icons. This will let the Shrew know to prepare the awesome icons. For example, the following code paints a red truck:

To explore icons, you can visit the list on fontawesome.com. When using the icons in Code Shrew, change their names to CammelCase. For example, to use an icon named bowling-ball, write icons.BowlingBall().

Icons' properties and methods

Just like shapes, icons can be modified using properties and methods. The following list applies to every icon.

Icons' properties

  • width (default: depends on the icon) - the width of the icon
  • height (default: depends on the icon) - the height of the icon
  • x (default: 50) - the horizontal coordinate describing where the center of the icon should be
  • y (default: 50) - the vertical coordinate describing where the center of the icon should be
  • color (default: "black") - the color or color gradient of the icon
  • transparency (default: 0) - how transparent the icon should be (from 0 to 100)
  • rotation (default: 0) - the amount of icon's rotation (from 0 to 360 degrees)

Icons' methods

  • copy() - create a new icon with the same properties as the original one
  • flip_horizontal() - flip the icon horizontally
  • flip_vertical() - flip the icon vertically
  • enlarge(amount) - make the icon amount times bigger (for example, my_rectangle.enlarge(2) will make the rectangle two times bigger)