Drawing text

Making my way through the Drawing text recipe from the Processing 2 Creative programming cookbook source code on GitHub.

In this recipe I learned how to declare PFont objects for the fonts to be used in the Sketch and set the second parameter of the textFont function to determine the size of the text. For example, textFont (junction, 18). I also learned how to use:

  • loadFont function to load the fonts into the PFont object
  • draw function to draw lines of text
  • text function to draw text to screen
  • textAlign function to align the text to the coordinates used in the text function. For example, LEFT, CENTER or RIGHT.
  • textWidth to return the width of a text block in pixels. In this Sketch, the width was the string of text “Nulla blandit ut magna”.
  • textLeading to set the leading of three different text blocks.

Screen-Shot-2014-02-26-at-8.39.11-PM

Another thing I learned from this recipe was how to use Create font tool that’s part of Processing to convert each font from its original format to a bitmap format used by Processing.

Screen-Shot-2014-02-26-at-8.48.29-PM

Screen-Shot-2014-02-26-at-8.43.19-PM

Working with images

Making my way through the Working with images recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned how to:

  • use the loadImage function to load an image from my data folder into my Sketch
  • declare a boolean (pixelMode) for the if test
  • use the image function to display the new images (dimensions specified in copWidth and copyHeight and areas specified by the pixel-swapping if test) in the window.

I also learned about the get and set methods and how they can be used to define a region and change the colour of the loaded image. Rad!

Screen Shot 2014-02-25 at 7.55.21 PM

Screen Shot 2014-02-25 at 7.55.31 PM

Screen Shot 2014-02-25 at 7.54.56 PM

Advertising inside Melbourne’s Metro Trains

An uncommon sight. Advertising on the inside one of  Melbourne’s Metro Trains. This could be a test for a possible revenue stream for the franchise operator of our suburban railway network. I’ve seen advertising on the outside of trains before, but never on the inside. This is new.

image

Also, the irony of an advertising campaign for Melbourne Airport on a train network that currently doesn’t and probably never will connect to the airport isn’t lost on me.

Working with colours

Making my way through the Working with colours recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned how to use the color function to create a variable of the type colour (c = colour variable), the stroke function to set the colour of the stroke, the fill function to set the fill colour of the shape. I also added an additional +130 to the height of displayHeight. I wanted the size and position of all the shapes to be relative to the window size (displayWidth, displayHeight), but I haven’t figured out how to do that yet.

Screen Shot 2014-02-11 at 6.32.15 PM