Commit graph

36 commits

Author SHA1 Message Date
Eric Rosenbaum
0540640684
Merge pull request #754 from ericrosenbaum/feature/pen-block-icon
Extension block icons (including pen icon)
2017-11-06 10:02:23 -05:00
Paul Kaplan
caa9b97520 Fix linting 2017-11-04 10:10:17 -04:00
Paul Kaplan
8616390fab Add back pen transparency from color number 2017-11-03 21:24:47 -04:00
Eric Rosenbaum
a115d47bb8 Add block icon svg as single-line data URI 2017-11-03 11:25:39 -04:00
Paul Kaplan
18398d010b Add hideFromPalette flag for hiding legacy blocks 2017-11-01 11:30:15 -04:00
Paul Kaplan
082e051cce Support legacy pen block op codes 2017-11-01 11:30:15 -04:00
Eric Rosenbaum
0a18ce7287 Lint 2017-10-18 13:16:24 -04:00
Eric Rosenbaum
bddabdbac6 JSDocs 2017-10-18 11:48:45 -04:00
Eric Rosenbaum
b5ad5e1f6b Warn on set or change unknown color parameter 2017-10-18 11:33:52 -04:00
Eric Rosenbaum
aab1b834d6 On set color using picker, reset transparency to 0 2017-10-17 23:13:05 -04:00
Eric Rosenbaum
a32f7a6402 Default color setting matches default RGB values
For color (hue) in range 0-100, to get RGB (0, 0, 1), we need to use 100 * 2/3 = 66.66
2017-10-17 23:10:58 -04:00
Eric Rosenbaum
240c48ad0c Set or change color param with a single function 2017-10-17 19:31:51 -04:00
Eric Rosenbaum
086df4652e Remove references to pen shade 2017-10-17 12:23:38 -04:00
Eric Rosenbaum
264042b4cc Use the word “color” instead of “hue” 2017-10-17 12:22:53 -04:00
Eric Rosenbaum
4f8782cc84 Remove unused function 2017-10-17 11:27:46 -04:00
Eric Rosenbaum
3d6644609f Add new set/change color param blocks with menu
And remove set/change color and shade blocks. All 4 params are now scaled 0-100.
2017-10-17 11:25:22 -04:00
Eric Rosenbaum
22e70ce095 Remove unused arguments for “clear” block 2017-10-17 11:25:22 -04:00
Christopher Willis-Ford
e9aed49a05 Make loadExtensionURL handle built-in extensions
WeDo2 and Pen blocks have been converted to internal extensions, and can
now be loaded by giving `loadExtensionURL` the string 'pen' or 'wedo2'
instead of an actual URL.
2017-10-04 13:00:39 -07:00
Christopher Willis-Ford
6757fb6de9 Convert pen blocks into an "internal" extension 2017-10-04 12:54:30 -07:00
Eric Rosenbaum
58eaeaaf6a Add pen transparency, clamped 0-100 2017-09-05 18:00:34 -04:00
Eric Rosenbaum
2b89063827 Merge branch 'patch-1' of https://github.com/Kenny2github/scratch-vm into Kenny2github-patch-1 2017-09-05 11:38:27 -04:00
Ken
3185eb27e1 Rewrote transparency block
Wrapping of the value is now handled by a new function, _wrapTransparency;
_updatePenColor now handles the transparency value;
DEFAULT_PEN_STATE now includes a transparency value (100).
2017-09-01 14:11:09 +08:00
Ken
f61366643d Clamp transparency value (at least for set) 2017-08-31 09:24:41 +08:00
Ray Schamp
5113876588 Pass with --fix 2017-08-26 13:24:10 -04:00
Ken
8a77329c79 Fix lint issue and update maximums
Inferring from the issue, the maximum seems to be 100, not 255 (default for set is 50 and change is 10). Changed that.
A comment line was too long (thanks lint) so it has now been reworded.
2017-08-25 15:24:56 +08:00
Ken
e30e5809d1 Add new blocks
change pen transparency by (num)
set pen transparency to (num)
2017-08-25 15:07:38 +08:00
Christopher Willis-Ford
06d5994a32 Use targetWasCreated event to clone pen state
Remove explicit cloning of `_customState` in favor of smarter,
state-specific cloning.
2017-06-16 14:22:51 -07:00
Ray Schamp
a4f095db5e Use ES6 style classes 2017-04-17 19:42:48 -04:00
Ray Schamp
e01c4ae108 Pass with --fix 2017-04-17 15:10:04 -04:00
griffpatch
2ba177aa0f Bug - Return pen opacity to opaque
When setting the pen color using pen blocks, the opacity should be reset
to fully opaque if no alpha is supplied.
2017-02-09 08:50:37 +00:00
Ray Schamp
727fcc7875 Lint for eslint-config-scratch@3 2017-02-01 16:27:55 -05:00
griffpatch
0dcaa46107 Fix lint issues
Had to update the test scripts to handle the alpha channel, also I note
that all the hex tests are using CSS notation, not scratch notation
(which is 0x not #)
2017-01-27 17:05:17 +00:00
griffpatch
b856041d9a Fix for Support ARGB for pen #393
Requires fix to scratch-render before this will work (see:
6f5acfee7b961d71237f1fd50bb3d5a5139c527e)
2017-01-27 13:45:16 +00:00
Christopher Willis-Ford
88cc50aa18 Code review: more docs, move constants, clone util
Changes include:
- Added missing JSDoc for items in `scratch3_pen.js` and `target.js`.
- Moved constants used by `Scratch3PenBlocks` into the class.
- Created a constant for minimum and maximum pen size.
- Added `util/clone.js` to host cloning functionality.
- Pen blocks now check for the renderer before trying to use it.
- The pen integration test covers all blocks, though `clear`, `stamp`,
  and `pen down` will skip some of their functionality when there is no
  renderer.
2017-01-20 11:26:18 -08:00
Christopher Willis-Ford
a6190da774 Lint fixes and related cleanup 2017-01-19 12:50:46 -08:00
Christopher Willis-Ford
369c02b5d5 Implement pen blocks
These blocks implement pen features as found in Scratch 2.0

Supporting changes include:
- `Target` is now an event emitter
- `RenderedTarget` now emits an event when it moves
- `Target` can now store arbitrary "extra" data, called "custom state"
  in the code, using a `Target`'s `setCustomState` and `getCustomState`
  methods. This is used to store per-target pen state without requiring
  `Target` or `RenderedTarget` to know anything about the pen.
- `Cast` can now cast to an RGB color object.
- `Color` now has functions to convert between RGB and HSV, constants
  for for black & white, and a `mixRgb` function to lerp between two
  colors.
2017-01-19 11:51:22 -08:00