© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
A. ColubriProcessing for Androidhttps://doi.org/10.1007/978-1-4842-9585-4_4

4. Drawing Graphics and Text

Andrés Colubri1  
(1)
University of Massachusetts, Worcester, MA, USA
 

In this chapter, we will take a closer look at the Processing API for drawing graphics and text, with several code examples illustrating the different functions in the API. We will also learn how to use the P2D renderer and the PShape class for better 2D performance.

Drawing Shapes

Chapter 2 gave us an overview of some basic elements of the drawing API in Processing. We saw how we can draw predefined shapes using functions like ellipse() or rect(), while we can also draw arbitrary shapes ...

Get Processing for Android: Create Mobile, Sensor-aware, and XR Applications Using Processing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.