This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExampleFrame extends Frame { | |
public ExampleFrame() { | |
super("Embedded PApplet"); | |
setLayout(new BorderLayout()); | |
PApplet embed = new Embedded(); | |
add(embed, BorderLayout.CENTER); | |
embed.init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void setup() { | |
// setup codes goes here | |
} | |
public void draw() { | |
// draw codes goes here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void setup() { | |
// Size of our sketch will be 800x600, | |
// and use the P2D rendering engine. | |
size(800, 600, P2D); | |
// We could have used this function instead of size() | |
// fullScreen(P2D); | |
// The background color of our sketch will be black | |
// by default, unless specified otherwise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int x = 0; | |
void setup(){ | |
} | |
void draw(){ | |
x += 1; | |
print(x+" "); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup(){ | |
} | |
void draw(){ | |
int x = 0; | |
x += 1; | |
print(x+" "); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// initialize x and y as 0 | |
int x=0; | |
int y=0; | |
void setup(){ | |
size(800,600); | |
background(255); // set background color to white | |
} | |
void draw(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
size(500, 500); | |
} | |
void draw() { | |
if (mousePressed) { | |
// Codes here will be executed as long as the mouse | |
// button is pressed | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "keys": ["super+t"], "command": "reindent", "args": {"single_line": false}}, | |
{ "keys": ["tab"], "command": "expand_abbreviation_by_tab", "context": | |
[ | |
{ "operand": "source.js", "operator": "equal", "match_all": true, "key": "selector" }, | |
{ "match_all": true, "key": "selection_empty" }, | |
{ "operator": "equal", "operand": false, "match_all": true, "key": "has_next_field" }, | |
{ "operand": false, "operator": "equal", "match_all": true, "key": "auto_complete_visible" }, | |
{ "match_all": true, "key": "is_abbreviation" } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
on: 'on_request', | |
reducer: ({ state, event }) => ({ ...state, loading: { [event.type]: true } }), | |
reaction: ({ event }) => api(event.path, event.params) | |
.then(res) => broadcast('request_success', res) | |
.catch(err) => broadcast('request_fail', err) | |
.finally() => broadcast('request_resolved', event) | |
}, | |
{ | |
on: 'request_resolved', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
submitted() { | |
broadcast('login_submitted', { | |
email: this.state.email, | |
password: this.state.password | |
}) | |
} | |
<form onSubmit={this.submitted}> | |
... | |
{ this.props.loading.login && <div>Loading...</div> } |
OlderNewer