Name

enableStyle()

Class

PShape

Description

Enables the shape's style data and ignores Processing's current styles. Styles include attributes such as colors, stroke weight, and stroke joints.

Examples

  • 
    PShape s;
    
    void setup() {
      size(400, 400);
      // The file "bot.svg" must be in the data folder
      // of the current sketch to load successfully
      s = loadShape("bot.svg");
    }
    
    void draw() {
      s.disableStyle();
      shape(s, -120, 40, 320, 320);
      s.enableStyle();
      shape(s, 200, 40, 320, 320);
    }
    
    Image output for example 1

Syntax

  • sh.enableStyle()

Parameters

  • sh(PShape) any variable of type PShape

Return

  • void