201707-15 我是小熊猫,分享一本《processing权威指南》 《processing权威指南》中文版:链接: http://pan.baidu.com/s/1dF5Yr3F 密码: u2cc 《processing权威指南》英文版:链接: http://pan.baidu.com/s/1miyY2es 密码: ymp7.... Read More >
201707-15 shader()将渲染器应用到参数确定的地方 shader() 例子 PShader edges; PImage img; void setup() { size(640, 360, P2D); img = loadImage("leaves.jpg"); edges = loadShader("edges.glsl"); } void draw() { shader(edges); i.... Read More >
201707-15 resetShader()回复默认的渲染器 resetShader() 例子 PShader edges; PImage img; void setup() { size(640, 360, P2D); img = loadImage("leaves.jpg"); edges = loadShader("edges.glsl"); } void draw() { shader(edges).... Read More >
201707-15 PGraphics图形对象 PGraphics 例子 PGraphics pg; void setup() { size(100, 100); pg = createGraphics(40, 40); } void draw() { pg.beginDraw(); pg.background(100); pg.stroke(255); pg.line(20, .... Read More >
201707-15 noClip()取消渲染范围 noClip() 例子 void setup() { size(200, 200); imageMode(CENTER); } void draw() { background(204); if (mousePressed) { clip(mouseX, mouseY, 100, 100); } else { noClip(); } li.... Read More >
201707-15 loadShader()载入着色 loadShader() 例子 PShader blur; void setup() { size(640, 360, P2D); // Shaders files must be in the "data" folder to load correctly blur = loadShader("blur.glsl"); stroke(0, 102, 153); .... Read More >
201707-15 textWidth()文本宽度 textWidth() 例子 textSize(28); char c = 'T'; float cw = textWidth(c); text(c, 0, 40); line(cw, 0, cw, 50); String s = "Tokyo"; float sw = textWid.... Read More >
201707-15 textSize()文本尺寸 textSize() 例子 background(0); fill(255); textSize(26); text("WORD", 10, 50); textSize(14); text("WORD", 10, 70); 描述 设置当前字体大小。这个字体大小将会对text() 函数后面.... Read More >
201707-15 textMode()文本绘制模式 textMode() 例子 import processing.pdf.*; void setup() { size(500, 500, PDF, "TypeDemo.pdf"); textMode(SHAPE); textSize(180); } void draw() { text("ABC", 75, 350); exit(); // Quit the pr.... Read More >
201707-15 textLeading()文本像素行距 textLeading() 例子 // Text to display. The "\n" is a "new line" character String lines = "L1\nL2\nL3"; textSize(12); fill(0); // Set fill to black .... Read More >
201707-15 textFont()文本字体 textFont() 例子 PFont mono; // The font "andalemo.ttf" must be located in the // current sketch's "data" directory to load successfully mono = load.... Read More >
201707-15 textDescent()文本下行高度 textDescent() 例子 float base = height * 0.75; float scalar = 0.8; // Different for each font textSize(32); // Set initial text size float a = text.... Read More >
201707-15 textAscent()文本上行间距 textAscent() 例子 float base = height * 0.75; float scalar = 0.8; // Different for each font textSize(32); // Set initial text size float a = textA.... Read More >
201707-15 textAlign()文本对齐方式 textAlign() 例子 background(0); textSize(16); textAlign(RIGHT); text("ABCD", 50, 30); textAlign(CENTER); text("EFGH", 50, 50); textAlign(LEFT); text.... Read More >
201707-15 text()绘制文本 text() 例子 textSize(32); text("word", 10, 30); fill(0, 102, 153); text("word", 10, 60); fill(0, 102, 153, 51); text("word", 10, 90); size(100, .... Read More >
201707-15 PFont字体类 PFont 例子 example pic PFont font; // The font must be located in the sketch's // "data" directory to load successfully font = createFont("LetterGothicStd.ttf", 32); textFont(font); text("word", 10, .... Read More >
201707-15 loadFont()加载字体 loadFont() 例子 example pic PFont font; // The font must be located in the sketch's // "data" directory to load successfully font = loadFont("LetterGothicStd-32.vlw"); textFont(font, 32); text("word".... Read More >