Discuss Scratch
- Discussion Forums
- » Suggestions
- » A New Clear Block
- im-a-cow
-
Scratcher
100+ posts
A New Clear Block
clear [ v] ::penThe pen should be able to clear pen from one sprite rather than all sprites in the project. This would be convenient if someone uses multiple pen sprites.
Last edited by im-a-cow (April 11, 2016 23:34:42)
- jokebookservice1
-
Scratcher
1000+ posts
A New Clear Block
EDIT: Semi-support, due to difficulty in implementation. I may change this later when I have a look at Scratch's pen source code
Last edited by jokebookservice1 (April 12, 2016 00:06:04)
- Zro716
-
Scratcher
1000+ posts
A New Clear Block
It isn't possible with the current way pen marks are stored. There would either have to be a separate canvas for every sprite or the pen markings would have to be recorded. Either way it would add massive overhead to the Scratch player for projects that heavily rely on pen.
- jokebookservice1
-
Scratcher
1000+ posts
A New Clear Block
It isn't possible with the current way pen marks are stored. There would either have to be a separate canvas for every sprite or the pen markings would have to be recorded. Either way it would add massive overhead to the Scratch player for projects that heavily rely on pen.A possible solution would be the addition of these blocks:
start multilayer canvassing ::penThus, projects which rely heavily on lag, and do not need to use the suggested block, can turn multilayer canvassing on. All pen created during multilayer canvasing being off can be cleared seperately, but together, by selecting the “Canvas” sprite like so:
//and
stop multilayer canvassing ::pen
clear [Canvas v] ::penand I also suggest that we add this:
clear [All v] ::penand remove this
clear
Last edited by jokebookservice1 (April 11, 2016 22:36:43)
- theory_
-
Scratcher
86 posts
A New Clear Block
It isn't possible with the current way pen marks are stored. There would either have to be a separate canvas for every sprite or the pen markings would have to be recorded. Either way it would add massive overhead to the Scratch player for projects that heavily rely on pen.Awesome idea! But, it can;t work for technical reasons! Dont get discouraged! Keep posting suggestions!
- jokebookservice1
-
Scratcher
1000+ posts
A New Clear Block
Wat if the extra blocks that I just posted above were added, would that allow it?It isn't possible with the current way pen marks are stored. There would either have to be a separate canvas for every sprite or the pen markings would have to be recorded. Either way it would add massive overhead to the Scratch player for projects that heavily rely on pen.Awesome idea! But, it can;t work for technical reasons! Dont get discouraged! Keep posting suggestions!
- Zro716
-
Scratcher
1000+ posts
A New Clear Block
Blocks don't solve it magically. The blocks you suggested would require a complete rewrite of all the pen block internal code as well as pretty much slow them down as a result. It isn't practical.Wat if the extra blocks that I just posted above were added, would that allow it?It isn't possible with the current way pen marks are stored. There would either have to be a separate canvas for every sprite or the pen markings would have to be recorded. Either way it would add massive overhead to the Scratch player for projects that heavily rely on pen.Awesome idea! But, it can;t work for technical reasons! Dont get discouraged! Keep posting suggestions!
- jokebookservice1
-
Scratcher
1000+ posts
A New Clear Block
It would use the current system fr using pen when one of the blocks are added, and the new “rewrite” code if the other has been activated. This would require a single if statement in the source-code, as well as a var that would be changed e.g.Blocks don't solve it magically. The blocks you suggested would require a complete rewrite of all the pen block internal code as well as pretty much slow them down as a result. It isn't practical.Wat if the extra blocks that I just posted above were added, would that allow it?It isn't possible with the current way pen marks are stored. There would either have to be a separate canvas for every sprite or the pen markings would have to be recorded. Either way it would add massive overhead to the Scratch player for projects that heavily rely on pen.Awesome idea! But, it can;t work for technical reasons! Dont get discouraged! Keep posting suggestions!
//JS, and yeah, I know Scratch uses ActionScript (I used the present tense, so I do mean 2.0)
multilayerCanvas = !(multilayerCanvas)
- Zro716
-
Scratcher
1000+ posts
A New Clear Block
I don't code in ActionScript but I know what the pen blocks “do” from what I have studied on GitHub. For one, the blocks create a context variable selecting the canvas as the object to draw on, and make the necessary pen strokes or changes.
To make your entire idea work, you don't just add a new variable that holds the state of multiple-canvas drawing. It's much more than “a single line of code” in ActionScript (which BTW should be initialized as “var multilayerCanvas:Boolean = false”, so it's already more than one line), and it's much much more work than you would think.
First, toggling it on and off is simply expensive and confusing. When toggled on, what happens to the main canvas? Does it vanish? Does it transfer over to another sprite? If it just goes hidden without clearing, that's fine but it still takes up memory. After that, the Scratch application must make a blank canvas for each sprite (this is how you should want your idea added, canvases do not have multiple layers). Besides increasing the load of the Scratch application, the myopia of this is how the “new” canvases are collated. Do they follow their own special order, or do they follow the order of the sprites? If the former, the the order would seem arbitrary and difficult to configure. If the latter, then that would require additional changes to the blocks in the Looks and Motion categories. When toggled off, the application must combine the canvases back into one main canvas, which again illustrates the problem of layering. You won't really know what gets painted first/last.
Second, every instance of pen block source code (we're talking dozens across several files) must be changed so that it either writes to the sprite's own canvas or the collective canvas that is shared by all sprites. In projects that perform thousands of pen processes in a short time, the added time needed to execute that extra bit of code would add up and worsen performance. You're better off keeping the code as optimized as you can rather than splitting pen strokes between multiple sprites.
tl;dr: It still won't work the way you want it to.
To make your entire idea work, you don't just add a new variable that holds the state of multiple-canvas drawing. It's much more than “a single line of code” in ActionScript (which BTW should be initialized as “var multilayerCanvas:Boolean = false”, so it's already more than one line), and it's much much more work than you would think.
First, toggling it on and off is simply expensive and confusing. When toggled on, what happens to the main canvas? Does it vanish? Does it transfer over to another sprite? If it just goes hidden without clearing, that's fine but it still takes up memory. After that, the Scratch application must make a blank canvas for each sprite (this is how you should want your idea added, canvases do not have multiple layers). Besides increasing the load of the Scratch application, the myopia of this is how the “new” canvases are collated. Do they follow their own special order, or do they follow the order of the sprites? If the former, the the order would seem arbitrary and difficult to configure. If the latter, then that would require additional changes to the blocks in the Looks and Motion categories. When toggled off, the application must combine the canvases back into one main canvas, which again illustrates the problem of layering. You won't really know what gets painted first/last.
Second, every instance of pen block source code (we're talking dozens across several files) must be changed so that it either writes to the sprite's own canvas or the collective canvas that is shared by all sprites. In projects that perform thousands of pen processes in a short time, the added time needed to execute that extra bit of code would add up and worsen performance. You're better off keeping the code as optimized as you can rather than splitting pen strokes between multiple sprites.
tl;dr: It still won't work the way you want it to.
Last edited by Zro716 (April 11, 2016 23:40:42)
- im-a-cow
-
Scratcher
100+ posts
A New Clear Block
I don't code in ActionScript but I know what the pen blocks “do” from what I have studied on GitHub. For one, the blocks create a context variable selecting the canvas as the object to draw on, and make the necessary pen strokes or changes.I thought it would be easy since that the only thing to do is track the pen traces of the sprite and when using this new
To make your entire idea work, you don't just add a new variable that holds the state of multiple-canvas drawing. It's much more than “a single line of code” in ActionScript (which BTW should be initialized as “var multilayerCanvas:Boolean = false”, so it's already more than one line), and it's much much more work than you would think.
First, toggling it on and off is simply expensive and confusing. When toggled on, what happens to the main canvas? Does it vanish? Does it transfer over to another sprite? If it just goes hidden without clearing, that's fine but it still takes up memory. After that, the Scratch application must make a blank canvas for each sprite (this is how you should want your idea added, canvases do not have multiple layers). Besides increasing the load of the Scratch application, the myopia of this is how the “new” canvases are collated. Do they follow their own special order, or do they follow the order of the sprites? If the former, the the order would seem arbitrary and difficult to configure. If the latter, then that would require additional changes to the blocks in the Looks and Motion categories. When toggled off, the application must combine the canvases back into one main canvas, which again illustrates the problem of layering. You won't really know what gets painted first/last.
Second, every instance of pen block source code (we're talking dozens across several files) must be changed so that it either writes to the sprite's own canvas or the collective canvas that is shared by all sprites. In projects that perform thousands of pen processes in a short time, the added time needed to execute that extra bit of code would add up and worsen performance. You're better off keeping the code as optimized as you can rather than splitting pen strokes between multiple sprites.
tl;dr: It still won't work the way you want it to.
clear [ v] :: penblock and selecting a sprite would clear all pen traces from that sprite.
- Zro716
-
Scratcher
1000+ posts
A New Clear Block
I thought it would be easy since that the only thing to do is track the pen traces of the sprite and when using this newAnd I have thought about that, but to record a lengthy history of pen commands by each sprite could lead to crashing.clear [ v] :: penblock and selecting a sprite would clear all pen traces from that sprite.
- jokebookservice1
-
Scratcher
1000+ posts
A New Clear Block
1) I said a single if statement and a var, not a single line f code
2) Is it cnfusing, and it isn't that expensive, no more than scratch's
3) I'm sorry for caps but PLEASE READ MY EARLIER POST where I explained that the conversion would cause the Main Canvas to become an entity called Canvas, wich can be cleared using the new block bu selecting from the dropdown “Canvas”
4) The user has turned the multilayer mode on, so it is their fault if the project lags
5) A pen block (defaults to Sprite layer (looks block))?
7) If there is no instance of the new block anywhere in the editor, the source code switches to the current one (if that makes sense?)
8) What does tl;dr: mean?
2) Is it cnfusing, and it isn't that expensive, no more than scratch's
change [ v] by (0)block, it is just changing a variable
3) I'm sorry for caps but PLEASE READ MY EARLIER POST where I explained that the conversion would cause the Main Canvas to become an entity called Canvas, wich can be cleared using the new block bu selecting from the dropdown “Canvas”
4) The user has turned the multilayer mode on, so it is their fault if the project lags
5) A pen block (defaults to Sprite layer (looks block))?
canvas to front ::pen6) Combination will be the last instance of the order of the Canvas's layer ordering
canvas back () layers ::pen
7) If there is no instance of the new block anywhere in the editor, the source code switches to the current one (if that makes sense?)
8) What does tl;dr: mean?
- Discussion Forums
- » Suggestions
-
» A New Clear Block







