Commit graph

231 commits

Author SHA1 Message Date
Paul Kaplan
9fce4d40d0 Fix bug with zero adding a costume/sound at index 0 2018-06-06 09:43:54 -04:00
Karishma Chadha
1639444a4d Fix lint and tests. 2018-05-30 21:18:45 -04:00
kchadha
a85f641d25
Merge pull request #1148 from kchadha/stage-layering
Layer group ordering.
2018-05-25 09:10:05 -04:00
Ken
5af6887cfe Round (x position) and (y position) to 8 places 2018-05-22 12:46:22 +08:00
Karishma Chadha
5e40bfb7ee No more explicit layer groups, and separate extension into video and pen. 2018-05-20 22:30:20 -04:00
Karishma Chadha
38875bc65c Bubbles should be in the same layer as sprites. Other cleanup. 2018-05-20 19:49:42 -04:00
Karishma Chadha
64c8484066 Refactor so that layer group is optionally passed into createClone (and initDrawable) instead of isStage property getting stored on a sprite. 2018-05-18 10:11:59 -04:00
Karishma Chadha
e2ce047fa1 Test and lint fixes. 2018-05-16 16:00:50 -04:00
Karishma Chadha
67b114b9c9 Layer group ordering. 2018-05-15 22:22:44 -04:00
kchadha
cde801bc17
Merge pull request #1075 from kchadha/load-costume-no-metadata
Load costume without metadata
2018-04-23 17:52:04 -04:00
Karishma Chadha
af7ed61016 Fix bitmap support. In Scratch 3.0, we are defaulting to bitmapResolution = 2 for all costumes. 2018-04-22 21:22:03 -04:00
Paul Kaplan
c36ff056a2 Add new event for all visual target changes, not just moving. 2018-04-20 10:43:45 -04:00
kchadha
0e0d09c235
Merge pull request #1042 from mzgoddard/target-video-state
Configure video device with stage video settings
2018-04-13 09:12:25 -04:00
kchadha
8739a524eb
Merge pull request #1031 from kchadha/block_serialization_compression
Block serialization compression
2018-04-11 19:17:42 -04:00
Michael "Z" Goddard
b9911332c7
Default stage.videoState to ON
Set to ON, adding a video extension when a user selects a video extension in
the gui, the video extension will use stage.videoState to turn on the video
device. Adding a video extension as part of loading a project, the stage's
videoState will be set to the stored value in the project's saved data, and the
extension will set the video device's state with that saved value.
2018-04-11 10:15:52 -04:00
Paul Kaplan
64c2d1f7b1
Merge pull request #1038 from paulkaplan/skin-size
Attach the costume size to the costume when loaded and modified
2018-04-11 09:30:02 -04:00
Karishma Chadha
2f53996c9c Switch video flipped string back to hyphen. 2018-04-10 15:43:29 -04:00
Paul Kaplan
92d00b5944 Filter out dragging targets from touching sprite check.
This introduces an asymmetry that matches the Scratch 2 behavior, that
is, a sprite that is being dragged can detect other sprites using
touching <sprite>, but cannot be detected by other sprites while it is
being dragged.
2018-04-10 14:20:51 -04:00
Paul Kaplan
f29482957c Change getSkinSize to getCurrentSkinSize for renderer update. 2018-04-10 09:50:18 -04:00
Karishma Chadha
9ce6040b0f Fix lint error... 2018-04-06 16:57:52 -04:00
Karishma Chadha
1861b5a262 Can't have hyphens in identifiers. 2018-04-06 16:51:46 -04:00
Karishma Chadha
9892dac904 Custom state (e.g. tempo, volume, video related state) should show up in a target that has been 'flattened' via JSON.stringify. 2018-04-06 11:33:44 -04:00
Eric Rosenbaum
5dc8e51c6d Import and store video state 2018-04-03 16:36:58 -04:00
Paul Kaplan
13641297fd
Merge pull request #996 from paulkaplan/fix-bubble-bounds
Position the speech bubble more tightly.
2018-03-23 14:36:52 -04:00
Paul Kaplan
ea534b35ea Position the speech bubble more tightly. 2018-03-23 10:51:19 -04:00
Eric Rosenbaum
4e3c5c7f2e
Merge pull request #991 from ericrosenbaum/bugfix/clones-share-activesoundplayers
Clones share their parent’s activeSoundPlayers object
2018-03-22 16:49:04 -04:00
Eric Rosenbaum
2527c804ea Clones get ref to parent’s activeSoundPlayers obj 2018-03-19 16:44:49 -04:00
Eric Rosenbaum
a7c6c430b8 Add volume to rendered target 2018-03-13 11:43:33 -04:00
DD Liu
97d3785554 Temporarily return real costumes array. GUI currently relies on this behavior somewhere 2018-03-05 11:07:50 -05:00
DD
b885402081 Merge branch 'develop' into privateSprite 2018-03-01 17:27:10 -05:00
Eric Rosenbaum
5d658b5ecb
Merge pull request #953 from ericrosenbaum/bugfix/load-tempo-from-sb2
Load tempo from sb2
2018-03-01 13:20:37 -05:00
Eric Rosenbaum
237616490f Add tempo property to rendered target 2018-02-27 11:48:14 -05:00
Karishma Chadha
8c5c68b896 Duplicating sprite should give new sprite a fresh name. 2018-02-26 23:17:25 -05:00
DD
9a65df4c12 Make index optional 2018-02-23 16:24:18 -05:00
DD
75cf6407d4 Duplicate costume 2018-02-23 10:50:45 -05:00
DD
d6bcfae526 Remove costume ID 2018-02-23 10:25:14 -05:00
DD
b4d6db0ad9 Fix tests 2018-02-22 15:45:41 -05:00
DD
729fc3d303 Make sprite.costumes private so that I can enforce that when you add costumes, they get assigned a unique ID 2018-02-21 19:59:35 -05:00
Karishma Chadha
f5813b1845 Update sprite names, plus some code cleanup. 2018-02-05 16:54:58 -05:00
Karishma Chadha
7faeed7128 Update blocks after sound/costume rename. 2018-02-05 14:35:52 -05:00
Eric Rosenbaum
115184a2a3
Merge pull request #891 from ericrosenbaum/bugfix/audioplayer-clone-state
Audio effects state for clones
2018-01-23 11:55:39 -05:00
Paul Kaplan
90e9e1c0b0
Merge pull request #889 from paulkaplan/fix-mouse-positions
Fix mouse positions for different stage zoom levels
2018-01-17 13:49:23 -05:00
Paul Kaplan
223575f850 Remove extra call to initDrawable that was erasing existing drawable.
initDrawable is called in createClone previously, where the new costumes
are installed. Calling this again here erases those loaded skins and
causes an error when trying to calculate the uniforms when a drag
starts.
2018-01-12 11:20:17 -05:00
Eric Rosenbaum
283804c21c Init and dispose audio player 2018-01-09 15:57:33 -05:00
Paul Kaplan
327d1179d9 Update the mouse io to give scratch coordinates and client coordinates
Fixes GUI #642 https://github.com/LLK/scratch-gui/issues/642

Fixes GUI #179 https://github.com/LLK/scratch-gui/issues/179
2018-01-09 10:37:16 -05:00
Paul Kaplan
4fd7ba896a
Merge pull request #881 from sjhuang26/issue-gui1127-pen-trails
No pen trails when dragging
2017-12-29 10:22:18 -05:00
sjhuang26
72dee72148 Change let to const 2017-12-29 09:13:18 -05:00
sjhuang26
f7d80459c7 Fixed pen behavior when dragging 2017-12-29 09:01:30 -05:00
sjhuang26
b726c4c18d Changed postSpriteInfo logic 2017-12-29 08:31:59 -05:00
Paul Kaplan
fe51bd6450 Update layering blocks 2017-12-28 14:40:08 -05:00
Paul Kaplan
cd66eb7f96 Allow size to be set through postSpriteInfo, and emit updates when it is
Required to allow size to be added to sprite info panel in the GUI.
2017-12-20 15:35:35 -05:00
Eric Rosenbaum
a71e06af43 Clones get a reference to parent’s audioPlayer 2017-11-28 12:29:45 -05:00
Paul Kaplan
14600d7893 Update looks implementation 2017-10-06 13:43:07 -04:00
Paul Kaplan
b68b874067 Add sprite duplication method 2017-09-07 11:51:21 -04:00
TheBrokenRail
936ff04b0f Fix setting Infinity to direction (#612)
* Create rendered-target.js

* Update math-util.js

* Update rendered-target.js

* Update math-util.js

* Update rendered-target.js
2017-07-26 17:44:02 -04:00
Paul Kaplan
f96a92b4d1 Move renaming and adding into rendered-target with tests 2017-07-25 10:32:25 -04: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
Christopher Willis-Ford
04871e24d6 Move RenderedTarget.runtime into Target
Some code in `Target` was already assuming a `runtime` property was
available, so this change just makes it official.
2017-06-16 13:16:13 -07:00
Christopher Willis-Ford
454082b569 Improve cleanup on clone disposal
The `dispose()` method on `RenderedTarget` now:
- informs the runtime that it should end any threads corresponding the
  target being disposed, and
- removes the clone from its sprite.
2017-06-07 17:05:24 -07:00
Paul Kaplan
3eaec99e51 Always activate the current costume after deleting 2017-05-22 08:17:28 -04:00
Paul Kaplan
423da12c3c Handle more cases of deleting costumes 2017-05-22 08:17:28 -04:00
Paul Kaplan
30a0c0d251 Allow deleting the last sound 2017-05-22 08:17:28 -04:00
Paul Kaplan
a608ca4fed Make rendered targets in charge of deleting their own sounds and costumes 2017-05-22 08:17:28 -04:00
Ray Schamp
20337b53f2 Stop emitting SPRITE_INFO_REPORT
Instead, set the `_refreshTargets` flag, and emit a full target list at the end of the step.
2017-05-12 11:42:22 -04:00
Ray Schamp
6c9701f4b2 Merge branch 'develop' into feature/serialization 2017-05-11 13:04:27 -04:00
Rasmus Haglund
d0f1b77209 Copy _customState for now until blocks have init functions 2017-05-05 21:58:18 +02:00
Ray Schamp
baee9a2793 Don't clean costume and sound lists
They are already clean, since we don't store the data on them any more.
2017-05-04 13:03:42 -04:00
Ray Schamp
f785117e1d Lint and fix failing tests 2017-04-27 17:49:57 -04:00
Ray Schamp
c9ce6776aa Get SB3 imports working
For now, store the md5 + extension on costumes in the VM. This way we can load them the same way as we load SB2 assets.
2017-04-27 17:08:06 -04:00
Ray Schamp
b2ea201707 Don't include asset data in exported JSON 2017-04-26 17:45:36 -04:00
Ray Schamp
a4cdb027ab Merge branch 'develop' of github.com:morantsur/scratch-vm into feature/serialization
# Conflicts:
#	src/playground/index.html
#	src/serialization/sb2.js
#	src/sprites/rendered-target.js
#	src/virtual-machine.js
#	test/unit/serialization_sb2.js
2017-04-26 11:44:53 -04: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
Chris Willis-Ford
44623db5e3 Merge pull request #522 from presight/develop
Fix so that size is set in float to ensure backward compatibility with Scratch 2.0
2017-04-06 14:55:08 -07:00
Paul Kaplan
8e84b2757e Report costume and sound data in sprite json 2017-04-06 09:37:39 -04:00
spenen
0f0292320b Added size to playground render info 2017-04-05 18:51:16 +02:00
spenen
8c7097f724 Fix #521 so that size is set in float to ensure backward compatibility with Scratch 2.0 2017-04-05 13:46:42 +02:00
Eric Rosenbaum
2303a1abc5 Remove call to loadSounds from rendered-target initDrawable 2017-03-27 11:56:28 -04:00
Moran
94d2a39cc1 Merge branch 'develop' of https://github.com/LLK/scratch-vm into develop 2017-03-13 18:07:17 -04:00
Christopher Willis-Ford
c23e9c6bf8 Load projects & costumes through scratch-storage
This also sets up the framework to load sounds through scratch-storage,
to be finished in a later change.
2017-03-09 11:25:55 -08:00
Paul Kaplan
5b82096670 Clear gfx on stop all 2017-03-06 15:54:52 -05:00
Moran
d8e1d42bf2 Merge branch 'develop' of https://github.com/LLK/scratch-vm into develop 2017-03-03 15:23:43 -05:00
Ray Schamp
bf2303f6de Merge pull request #490 from rschamp/dnd
Add methods for dragging and dropping sprites
2017-03-03 09:50:34 -05:00
Ray Schamp
d0cd9cd897 Add methods for dragging and dropping sprites
* Add `getTargetIdForDrawableId` to translate between renderer picks and VM targets
* Add `startDrag` to stop sprite motion while dragging
* Add `stopDrag` to return sprite motion after dragging
2017-03-03 09:43:31 -05:00
Ray Schamp
319f27a060 Merge pull request #487 from rschamp/draggability
Add draggable property to sprites
2017-03-02 15:56:12 -05:00
Andrew Sliwinski
a4578ba086 Default bitmapResolution to 1 if not provided in costume metadata (#485)
* Default bitmapResolution to 1 if not provided in costume metadata. Resolves GH-484
2017-03-02 11:21:01 -05:00
Ray Schamp
8dadc42857 Add draggable property to sprites
This property should be managed by the VM so that it can be displayed in the sprite info panel in the GUI.
2017-03-01 18:49:17 -05:00
Ray Schamp
370f2c6a47 Merge pull request #459 from griffpatch/feature/FencingAgain
Feature fencing again
2017-02-24 11:27:10 -05:00
Chris Willis-Ford
a56db95aba Merge pull request #446 from magmaboat/hasownproperty
Perform hasOwnProperty validation
2017-02-22 13:55:54 -08:00
griffpatch
7bc141e76e Feature Fencing
This is a re-comit after the previous pull was reverted.
2017-02-15 15:59:54 +00:00
Ray Schamp
39158c9d48 Revert "Feature fencing" 2017-02-15 09:40:10 -05:00
griffpatch
75e3f6002b Fencing - Take 3
Dependant on scratch-render pull request.
2017-02-14 09:12:35 +00:00
Christopher Willis-Ford
bd76395676 Minor cleanup around cloning methods 2017-02-13 14:44:51 -08:00
griffpatch
4d63dcac3b Rename fencing method 2017-02-11 14:30:18 +00:00
Magmaboat
85eee4f18e Perform hasOwnProperty validation 2017-02-09 21:12:47 -05:00
griffpatch
464722f7bd Feature - Fencing of sprites
This change requires that the pull request for scratch-render (Feature
fencing #82) be taken first
2017-02-09 10:02:45 +00:00
morant
ed978e3062 Read sprite costume names from JSON, and write currentCostume to JSON 2017-02-07 20:12:55 -05:00
morant
0dc1883e9f Write costumes and sounds to JSON on save 2017-02-07 18:15:11 -05:00
morant
e16f2924a3 Merge branch 'develop' of https://github.com/LLK/scratch-vm into develop 2017-02-07 09:53:17 -05:00
Eric Rosenbaum
9741dc2e35 Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound 2017-02-02 16:37:07 -05:00