Sha256: c2d15c374d3a86fb956340a28973fdfa7a55532efbebb67b4c08726d48accf2c

Contents?: true

Size: 1.1 KB

Versions: 12

Compression:

Stored size: 1.1 KB

Contents

---
layout: post
title:  "settings"
permalink: methods/settings.html
---
All sketches require a user defined [settings][settings] method. This is where you define the sketch size (can be fullscreen) and render mode. Regular processing sketches hide this in a pre-process step that converts `pde` code to valid java code (on linux you can find the java code in the `/tmp` folder, and in some other temporary location on MacOS and Windows).

Minimal code default renderer:-
```ruby
def settings
  size 200, 200
end
```

Minimal code fullscreen default renderer:-
```ruby
def settings
  fullscreen
end
```

Minimal code fullscreen opengl 3D renderer:-
```ruby
def settings
  size 200, 200, P3D
end
```

Minimal code fullscreen opengl 3D renderer:-
```ruby
def settings
  fullscreen P3D
end
```

For hi-dpi screens:-

```ruby
def settings
  size 200, 200
  pixel_density(2)
end
```

You should also put `smooth` inside [settings][settings]

NB: as with vanilla-processing you can access the `width` and `height` variables within the sketch, eg in draw loop or mouse_pressed.
[settings]:https://processing.org/reference/settings_.html

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
picrate-0.8.0-java docs/_methods/settings.md
picrate-0.7.0-java docs/_methods/settings.md
picrate-0.6.0-java docs/_methods/settings.md
picrate-0.5.0-java docs/_methods/settings.md
picrate-0.4.3-java docs/_methods/settings.md
picrate-0.4.2-java docs/_methods/settings.md
picrate-0.4.1-java docs/_methods/settings.md
picrate-0.4.0-java docs/_methods/settings.md
picrate-0.3.0-java docs/_methods/settings.md
picrate-0.2.0-java docs/_methods/settings.md
picrate-0.1.0-java docs/_methods/settings.md
picrate-0.0.3-java docs/_methods/settings.md