Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #17449 > unrolled thread
| Started by | k <kalezwe@gmail.com> |
|---|---|
| First post | 2012-12-03 21:19 -0800 |
| Last post | 2012-12-04 09:35 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.javascript
No Function Google Script k <kalezwe@gmail.com> - 2012-12-03 21:19 -0800
Re: No Function Google Script Stefan Weiss <krewecherl@gmail.com> - 2012-12-04 09:35 +0100
| From | k <kalezwe@gmail.com> |
|---|---|
| Date | 2012-12-03 21:19 -0800 |
| Subject | No Function Google Script |
| Message-ID | <e4354d0c-6035-437c-9bb4-fe138c989387@googlegroups.com> |
I am trying to save this as a web app to attach to Google sites but it says I need a function can some one please help me understand and change my code to make it work.
var y=178;
var draw = function() {
background(133, 142, 245);
textSize(40);
text("Snow",70,180);
//cloud
noStroke();
ellipse(93,10,100,100);
ellipse(134,34,100,100);
ellipse(185,24,100,100);
ellipse(249,26,100,100);
ellipse(320,11,100,100);
//ground
rect(0,347,402,56);
ellipse(295,378,368,84);
ellipse(100,359,262,68);
//snow
for (var i = 0; i < 1; i+=1){
ellipse(287,y-140,12,12);
ellipse(249,y-141,12,12);
ellipse(61,y-137,12,12);
ellipse(105,y-165,12,12);
ellipse(170,y-165,12,12);
ellipse(194,y-178,12,12);
ellipse(345,y-180,12,12);
ellipse(287,y-254,12,12);
ellipse(240,y-240,12,12);
ellipse(92,y-225,12,12);
ellipse(79,y-262,12,12);
ellipse(216,y-257,12,12);
ellipse(163,y-259,12,12);
ellipse(363,y-259,12,12);
ellipse(287,y-320,12,12);
ellipse(249,y-338,12,12);
ellipse(61,y-365,12,12);
ellipse(105,y-394,12,12);
ellipse(170,y-334,12,12);
ellipse(194,y-342,12,12);
ellipse(345,y-295,12,12);
ellipse(287,y-374,12,12);
ellipse(240,y-456,12,12);
ellipse(92,y-423,12,12);
ellipse(79,y-413,12,12);
ellipse(216,y-452,12,12);
ellipse(163,y-488,12,12);
ellipse(363,y-469,12,12);
fill(255, 255, 255);
y = y+1;
}
};
[toc] | [next] | [standalone]
| From | Stefan Weiss <krewecherl@gmail.com> |
|---|---|
| Date | 2012-12-04 09:35 +0100 |
| Message-ID | <k9kckb$964$1@news.albasani.net> |
| In reply to | #17449 |
On 2012-12-04 06:19, k wrote:
> I am trying to save this as a web app to attach to Google sites but
> it says I need a function can some one please help me understand and
> change my code to make it work.
>
> var y=178;
> var draw = function() {
> background(133, 142, 245);
> textSize(40);
> text("Snow",70,180);
> //cloud
> noStroke();
> ellipse(93,10,100,100);
[snip rest]
None of the functions background(), textSize, text(), noStroke(),
ellipse(), etc, are native JavaScript. This looks like Processing.js;
did you forget to load a library?
By the way,
> for (var i = 0; i < 1; i+=1){
this loop is pointless, it just means "do once".
- stefan
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web