Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Setup & Draw

Atsuya Sato edited this page Nov 30, 2018 · 5 revisions

Setup & Draw


func setup()

Available

iOS, OSX

Examples

func setup() {
  // setup() runs once
}

Description

The setup() function is run once, when the view instantiated. It's used to define initial enviroment properties such as screen size and to load media such as images and fonts as the program starts. There can only be one setup() function for each program and it shouldn't be called again after its initial execution.


func draw()

Available

iOS, OSX

Examples

func draw() {
  // Loops forever, until stopped 
}

Description

Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called. draw() is called automatically and should never be called explicitly. All Processing programs update the screen at the end of draw(), never earlier.

Clone this wiki locally