Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 More details and explanation …

Slides:



Advertisements
Similar presentations
Physical Computing INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.
Advertisements

This Time Whitespace and Input/Output revisited The Programming cycle Boolean Operators The “if” control structure LAB –Write a program that takes an integer.
Mouse Listeners We continue our examination of GUIs by looking at how to interact with the mouse –Just as Java creates Events when the user interacts with.
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Changing Control.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Introduction To Computers and Programming Lecture 2: Your first program Professor: Evan Korth New York University.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
2.02E Adding and Animating Text into Computer Animations 2.02 Develop Computer Animations.
PROCESSING Animation. Objectives Be able to create Processing animations Be able to create interactive Processing programs.
Excel Navigation. Instructions Use this PowerPoint presentation as you answer the Excel Navigation worksheet questions. Have Excel open also and use ALT.
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
Mastering Your Word Processing Skills
Review Blocks of code {.. A bunch of ‘statements’; } Structured programming Learning Processing: Slides by Don Smith 1.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
A computer is an electronic device used to process data, converting data into information that is useful to people.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
1 Grade Chapter  To know Parts of the computer, follow these steps as shown below:
Computer Parts Hardware.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
The string data type String. String (in general) A string is a sequence of characters enclosed between the double quotes "..." Example: Each character.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange.
Creating a Project with C++ Builder
Keyboard and Events. What about the keyboard? Keyboard inputs can be used in many ways---not just for text The boolean variable keyPressed is true if.
Processing Lecture.2 Mouse and Keyboard
Intro to More Controls in C#. C# Demonstration We already touched on labels and buttons Ad-hoc demo of controls – Textboxes Multiline – Checkbox – Radiobutton.
CPSC1301 Computer Science 1 Chapter 14 Creating and Modifying Movies part 2.
Introduction to Windows Programming
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Assignment 6.
Computer programming Lecture#2 أ. إلهام باسندوه 1.
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
CIS 3.5 Lecture 2.2 More programming with "Processing"
Variables Art &Technology, 3rd Semester Aalborg University Programming David Meredith
VARIABLES Programmes work by manipulating data placed in memory. The data can be numbers, text, objects, pointers to other memory areas, and more besides.
Mouse Inputs in Processing. Interacting with the Mouse mouseX and mouseY: pg mouseXmouseY –The position of the mouse in the canvas pmouseX and.
Test 2 Review. General Info. All tests are comprehensive. You are still responsible for the material covered prior to the first exam. You will be tested.
Words. Characters and Strings Character –A single character inside of single quotes char letter = 'A' ; char digit = '0' ; – Strings Zero or more character.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
Computer Science I Recap: variables & functions. Images. Pseudo-random processing.
In this activity, we are going to type a simple Chinese sentence with Microsoft Word by Tsang-jei Input Method and Simplified Tsang-jei Input Method. 1Start.
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 2 More Programming with Processing.
Computer Vocabulary Computer
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Functional Abstraction Reduces Complexity.
2c – Textboxes and Buttons Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Computer Programming 2 Lab (1) I.Fatimah Alzahrani.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
VBQU149 Create texts of some complexity. Columns Making columns in Microsoft Word Open word and blank page type =rand() Go to page layout, then columns.
Computer Science I Go over midterm. Reprise on curves. Table examples. The map function. Testing Strings. Fonts. Classwork/Homework: Complete midterm project.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Variables. Something to mention… void setup(){ size(200, 200); background(255); smooth(); } void draw() { stroke(0); strokeWeight(abs(mouseX-pmouseX));
Basic Input and Output CSE 120 Spring 2017
Tuples and Lists.
GETTING STARTED WITH PREZI
Review As binary, what is /20/2018
Basic Input and Output CSE 120 Winter 2018
GETTING STARTED WITH PREZI
Mouse Inputs in Processing
Announcements Mid-Term Exam!! Quiz 5 Again + Quiz 6 Exercise 5
More programming with "Processing"
Announcements How’s it going? My internet/power supply?
Testing and Repetition
Chap 17 Section 3.
Basic Input and Output CSE 120 Winter 2019
Lawrence Snyder University of Washington, Seattle
Announcements How to save your work? Quiz solution 5/5/2019
Basic Processing … Drawing pictures … It’s not art, it’s fun
Presentation transcript:

Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 More details and explanation …

 An important part of computing is the input to the program and the output it produces  We consider three types of I/O  Mouse Input  Key Input  Text Input 12/13/2015© 2010 Larry Snyder, CSE2

 So that it is all out there, here’s the situation on the mouse (you’ve seen most of this):  mouseX and mouseY give the coordinates of the mouse on the canvas … recall: rect(mouseX, mouseY, 20, 20);  void mousePressed ( ) { dir = 0 – dir; }  There’s also mouseReleased that “fires” when the mouse is released after being pressed 12/13/2015© 2010 Larry Snyder, CSE3

 Control “looping” with the mouse 12/13/2015© 2010 Larry Snyder, CSE4 Just Do It

 Control “looping” with the mouse 12/13/2015© 2010 Larry Snyder, CSE5 … Looping off Turn looping on Turn looping off

 Pressing a key is like pressing mouse button … 12/13/2015© 2010 Larry Snyder, CSE6 Result of typing g y m m y g Just Do It

 The key keyword has the value of the key just pressed; it has the datatype of a character, that is, char  Notice that characters are enclosed in single quotes: 12/13/2015© 2010 Larry Snyder, CSE7

12/13/2015© 2010 Larry Snyder, CSE8

 Processing is great for graphics and images, but it is a little more cumbersome for text  Follow these steps:  1) Go to tools and locate the font you want  2) Load font into the data directory of your program … this happens automatically when you load  3) In the code, load the font into the computation (get name and size perfect); specify its use  4) Use text( ) to print text; color using fill( ) 12/13/2015© 2010 Larry Snyder, CSE9

 “Create Font …” is under Tools 12/13/2015© 2010 Larry Snyder, CSE10

12/13/2015© 2010 Larry Snyder, CSE11  Try to pick common fonts  Click to load font into the data directory

12/13/2015© 2010 Larry Snyder, CSE12  Try to pick common fonts  Click to load font into the data directory

12/13/2015© 2010 Larry Snyder, CSE13  Need to declare font name(s)

12/13/2015© 2010 Larry Snyder, CSE14  Need to declare font name(s)  Need to load named font

12/13/2015© 2010 Larry Snyder, CSE15  Need to declare font name(s)  Need to load named font  Need to select named font as “in use”

12/13/2015© 2010 Larry Snyder, CSE16  Need to declare font name(s)  Need to load named font  Need to select named font as “in use”  Then, fill( ) and write text( … );

12/13/2015© 2010 Larry Snyder, CSE17

12/13/2015© 2010 Larry Snyder, CSE18 A String is a datatype of a letter sequence. The sequence must be surrounded by (double) quotes. "" is the empty String.

12/13/2015© 2010 Larry Snyder, CSE19 A String is a datatype of a letter sequence. The sequence must be surrounded by (double) quotes. "" is the empty String. A character can be added to a String (it’s called concatenation) using a + sign.

12/13/2015© 2010 Larry Snyder, CSE20 A String is a datatype of a letter sequence. The sequence must be surrounded by (double) quotes. "" is the empty String. A character can be added to a String (it’s called concatenation) using a + sign. Use the String like any quoted letter sequence.

12/13/2015© 2010 Larry Snyder, CSE21 A String is a datatype of a letter sequence. The sequence must be surrounded by (double) quotes. “” is the empty String. A character can be added to a String (it’s called concatenation) using a + sign. Type A B C

12/13/2015© 2010 Larry Snyder, CSE22 A String is a datatype of a letter sequence. The sequence must be surrounded by (double) quotes. “” is the empty String. A character can be added to a String (it’s called concatenation) using a + sign. Type A B C Just Do It