m (hmmm)
(added helpful sentence, just so y'all know I contribute)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{block
 
{{block
 
| name      = Change Size by ()
 
| name      = Change Size by ()
| image      = File:2.0 Change Size by ().png
+
| image      = change size by ()
 
| imagewidth = 122
 
| imagewidth = 122
 
| category  = [[Looks Blocks|Looks]]
 
| category  = [[Looks Blocks|Looks]]
 
| type      = [[Stack Block|Stack]]
 
| type      = [[Stack Block|Stack]]
 
| default    = 10
 
| default    = 10
 +
| sb        = yes
 
}}
 
}}
 
The '''Change Size by ()''' [[Blocks|block]] is a [[Looks Blocks|Looks block]] and a [[Stack Block|Stack block]]. The block changes its [[sprite]]'s size by the specified amount. The default sprite size is 100; size values below that percentage are for shrunken sprites, and size values above it are for overlarge sprites.
 
The '''Change Size by ()''' [[Blocks|block]] is a [[Looks Blocks|Looks block]] and a [[Stack Block|Stack block]]. The block changes its [[sprite]]'s size by the specified amount. The default sprite size is 100; size values below that percentage are for shrunken sprites, and size values above it are for overlarge sprites.
Line 26: Line 27:
 
set size to ((size) + (amount))%
 
set size to ((size) + (amount))%
 
</scratchblocks>
 
</scratchblocks>
However, this is not exact because the main block rounds it and the math block gives exact numbers.<ref>https://github.com/LLK/scratch-flash/blob/develop/src/primitives/LooksPrims.as#L244</ref>
+
You can also decrease the size by using the minus operator. However, this is not exact because the main block rounds it and the math block gives exact numbers.<ref>https://github.com/LLK/scratch-flash/blob/develop/src/primitives/LooksPrims.as#L244</ref>
  
 
== References ==
 
== References ==

Latest revision as of 12:28, 30 December 2019

Change Size by ()
change size by ()
Category Looks
Type Stack

The Change Size by () block is a Looks block and a Stack block. The block changes its sprite's size by the specified amount. The default sprite size is 100; size values below that percentage are for shrunken sprites, and size values above it are for overlarge sprites.

Example Uses

As this block changes its sprite's size, it is used whenever a sprite's size must be changed. Some common uses are:

  • A sprite in a 3D world that must change its size as it moves along the plain
  • A growing object
  • A shrinking object, usually to the point where it can be hidden, this can be achieved by puting a minus - infront of the value, for example, if you want the sprite to shrink slowly, you would put -1 in the block
  • Changing the size of a paintbrush for painting
  • Draining a pool of water by shrinking the water sprite
  • Making an object that grows and shrinks continuously

Workaround

Main article: List of Block Workarounds

The block can be replicated with the following code:

set size to ((size) + (amount))%

You can also decrease the size by using the minus operator. However, this is not exact because the main block rounds it and the math block gives exact numbers.[1]

References

  1. https://github.com/LLK/scratch-flash/blob/develop/src/primitives/LooksPrims.as#L244

See Also