GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Processing
  • Download
  • Reference
  • Environment
  • Libraries
  • Tools
  • Wiki
  • Tutorials
  • Examples
  • Books
  • Forum
  • Overview
  • People
  • Privacy

This view

  • Original page
  • New address

GeezerVison is showing processing.org — shape() / Reference

Reference+
Documentation→Reference→Shape→Loading & Displaying

Name

shape()

Description

Draws shapes to the display window. Shapes must be in the sketch's "data" directory to load correctly. Select "Add file..." from the "Sketch" menu to add the shape. Processing currently works with SVG, OBJ, and custom-created shapes. The shape parameter specifies the shape to display and the coordinate parameters define the location of the shape from its upper-left corner. The shape is displayed at its original size unless the c and d parameters specify a different size. The shapeMode() function can be used to change the way these parameters are interpreted.

Examples

  • PShape s;
    
    void setup() {
      size(400,400);
      s = loadShape("bot.svg");
    }
    
    void draw() {
      shape(s, 40, 40, 320, 320);
    }

Syntax

  • shape(shape)
  • shape(shape, x, y)
  • shape(shape, a, b, c, d)

Parameters

  • shape(PShape)the shape to display
  • x(float)x-coordinate of the shape
  • y(float)y-coordinate of the shape
  • a(float)x-coordinate of the shape
  • b(float)y-coordinate of the shape
  • c(float)width to display the shape
  • d(float)height to display the shape

Return

  • void

Related

  • PShape
  • loadShape()
  • shapeMode()
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.