Keepin 0,0 translate on Cp5-elements but not on the rest.

edited August 2016 in Library Questions

I would like to pushMatrix before the translate statement and pop it after the text statement. But it's no possible. Is there another way to keep the cp5 elements from listening to the translate(400, 400) and make them (0,0)

import controlP5.*; ControlP5 cp5;

public float sliderBredd = 0; public float sliderHojd = 0;

PFont myFont;

void setup() { size(800, 800); cp5 = new ControlP5(this);

cp5.addSlider("sliderBredd") .setRange(-255, 255) .setPosition(40, 40) .setSize(200, 29) ;

cp5.addSlider("sliderHojd") .setRange(-255, 255) .setPosition(40, 80) .setSize(200, 29) ; }

void draw () { background(255, 255, 255); myFont = createFont("Times-Roman", 48); textFont(myFont, 272); translate(400, 400);

for (int i=0; i<12; i=i+1) {

fill(14, 105, 237);
textAlign(CENTER);
rotate(PI*1/3);
text("Q", sliderBredd, sliderHojd);

} }

Answers

Sign In or Register to comment.