265 Commits

Author SHA1 Message Date
Florrie
4189377128 Fix empty speech bubbles showing up squished 2018-11-16 11:29:06 -04:00
Andrew Sliwinski
4ae7e32b8c
Merge pull request #354 from mzgoddard/fix-touching-mouse
Fix touching mouse
2018-11-02 08:59:07 -04:00
Andrew Sliwinski
9ab14e34dd
Merge pull request #339 from mzgoddard/round-position
Round drawable position
2018-10-29 08:52:17 -04:00
Michael "Z" Goddard
14813e590c
replace hsl color handling with hsv (#355)
Scratch 2 color and brightness effects in HSV color space.
2018-10-23 15:13:54 -04:00
Michael "Z" Goddard
bd14d53fb2
make sure drawable matrix and silhouette for mouse touching
RenderWebGL methods that test drawable touching should call
updateMatrix and updateSilhouette before calling drwaable.isTouching.
These methods are called by RenderWebGL instead of isTouching because
isTouching can be called repeatedly in quick succession. Calling update
methods in isTouching would waste a lot of cycles.
2018-10-04 11:50:38 -04:00
Marcus Weiner
fdea47d31c Fix bug when bounds would be infinite and cause never ending loop 2018-09-22 22:29:23 +02:00
Ray Schamp
24737982f0
Merge pull request #347 from rschamp/snapshots
Add ability to get a snapshot of the next frame
2018-09-18 16:06:46 -04:00
Ray Schamp
997062c851 Add JSDoc for requestSnapshot 2018-09-18 15:55:49 -04:00
Ray Schamp
90b1c47c3e Add getter for the renderer's canvas
Resolves #309
2018-09-18 15:21:01 -04:00
Ray Schamp
550cd7aacf Add ability to get a snapshot of the next frame 2018-09-18 15:01:22 -04:00
Michael "Z" Goddard
b901c1ac75
round drawable position
Scratch 2 rendered sprite position is at whole numbers, while its vm
position may be rational numbers.
2018-08-24 18:19:19 -04:00
Christopher Willis-Ford
3ff532dbee Quick fix for line drawing gaps
This fixes 238747426 and mostly fixes 197728370 without breaking 225569460
2018-08-10 18:30:38 -07:00
Michael "Z" Goddard
4c8bc5d806
Framebuffer PenSkin (#319)
* draw pen skin lines and stamps to a framebuffer

* skip reading pixels and draw stamp to framebuffer

* update silhouette with readPixels

* draw pen canvas to buffer when its dirty

Composite lines and stamps on browser preferred side (cpu/gpu) until
the export texture is needed. Then blend the canvas with the current
buffer contents.

Updating this way invalidates useProgram optimization and the renderer
currently does not have a way to know this.

* draw lines on framebuffer through fragment shader

* optimize draw regions and pen skin matrix creation

* control draw regions

* mobile gpus need high precision floats for line drawing

* optimize cpu pen line math

* sampled pen line caps

* sampleless pen skin lines, lint, document pen skin buffer ops

* add PenSkin._canvasDirty to constructor

* remove DRAW_MODE_line

* comment PenSkin reused memory, use memory in drawRectangle

* turn draw region id's into optional method handlers

A region ID object may have an enter and exit method on it that are
used by default when entering and exiting that region.

* remove old DRAW_MODE_line precision setting

* standardize vert lines on 4 spaces

* fixup! turn draw region id's into optional method handlers

* do not draw when updating pen skin silhouette

* do not premultiply stamp colors by alpha

* fixup! do not draw when updating pen skin silhouette

* do not premultiply line color

* add a small rim around the line for aliasing

* variable pen line alias amount

* reverse offset pen line on y axis by relative alias amount

Reverse the offset to keep small line overlap to a minimum.

* fixup! reverse offset pen line on y axis by relative alias amount

* medium precision gpu floats
2018-08-08 14:30:51 -04:00
Mx Corey Frang
c54a928f0a
Touching color implementation (#312)
* Touching color draft implementation

* New constant for CPU/GPU render split determined, removing query param

* Small fix for pick tests
2018-08-08 14:20:35 -04:00
Michael "Z" Goddard
d88b2b4df4 offset pen lines of width 1 and 3 (#314) 2018-08-08 14:05:30 -04:00
Michael "Z" Goddard
c08b853519 add uniformName to ShaderManager EFFECT_INFO entries (#328) 2018-08-08 14:04:37 -04:00
Mx Corey Frang
6863613d20
Optimizing isTouching while creating a drawableTouches for sensing mouse pointer (#325)
* Allow 'isTouching' and 'pick' to still work on invisible drawables.

* Always ignore visibility for isTouching on drawable

* Filter invisble drawbles in isTouchingDrawable per rules of collision

* polish up some docs/get logic 👍

* leftover line from deleted comment

* revert to ghosted pick behavior

* Add clientSpaceToScratchBounds method

* fix lint

* add some pick tests
2018-08-07 10:56:28 -04:00
Karishma Chadha
11671ee885 Add API for getting the drawable order of a given drawable. 2018-07-24 11:05:38 -04:00
Michael "Z" Goddard
9b869e0da7 Depend on script dependencies for downstream webpack
Downstream webpack will need any dependencies src/ depends on so it can
successfully build. Also if multiple packages being built into a larger
script share a common dependency version range, they can share the
dependency instead of duplicating it. This will save built file size,
execution time, and memory.
2018-05-31 16:49:21 -04:00
Paul Kaplan
d7e39a35d7
Merge pull request #296 from paulkaplan/fix-escaping
Remove duplicate xml escaping
2018-05-29 16:18:31 -04:00
Paul Kaplan
44c30d76ad Add snapshot test for bubble svg strings 2018-05-29 15:28:16 -04:00
Paul Kaplan
d7b26ea1be Remove duplicate xml escaping
We used to write the user string directly into the svg string, but now we are setting the `.textContent` of an actual dom node, which does the escaping for us.
2018-05-29 14:25:35 -04:00
kchadha
d8f82b21ec
Merge branch 'develop' into layer-ordering 2018-05-25 09:23:02 -04:00
Paul Kaplan
5009692426 Add an explicit width and height to fix bubbles on retina screens 2018-05-22 09:35:41 -04:00
DD
8abffc7f0b Add viewbox to speech bubble svgs 2018-05-21 14:42:32 -04:00
Karishma Chadha
5205f9cb87 Fix up comments. 2018-05-21 09:47:57 -04:00
Karishma Chadha
f9e2fe5c80 update playground to accommodate new apis. 2018-05-20 22:11:29 -04:00
Karishma Chadha
ce4296be82 Make layer group required and get rid of explicitly ordered layer groups. 2018-05-20 22:07:38 -04:00
Karishma Chadha
2dac278f90 Fix lint errors. 2018-05-20 19:40:21 -04:00
Karishma Chadha
39ce51c6f0 Store offsets for each layer group and use full draw list for updates. 2018-05-20 18:56:39 -04:00
DD
71ecef29a2 Merge branch 'develop' into removeRenderQuirks 2018-05-16 15:16:11 -04:00
DD
528ae873d7 Remove speech bubbles' reliance on svg quirks mode's _transformText 2018-05-16 15:00:04 -04:00
Karishma Chadha
b7ac54293d @type tag does not permit descriptions. 2018-05-16 11:17:57 -04:00
Karishma Chadha
2a4f6f9f02 Add layer groups to control explicit and implicit layer ordering. 2018-05-15 22:06:27 -04:00
Paul Kaplan
d35a3205bd Actually fix the font in the say bubbles 2018-05-11 14:41:39 -04:00
Paul Kaplan
e8ba24a43e Prevent errors when testing empty silhouettes 2018-05-11 14:05:16 -04:00
Paul Kaplan
905a346161 Subvert the font converter to maintain the font in text bubbles 2018-05-11 13:23:13 -04:00
DD
3be6a4d4a8 Fix jsdoc 2018-05-04 10:22:47 -04:00
Paul Kaplan
c85a13958a
Merge pull request #267 from paulkaplan/sudo-fix-color-bug
Fix color inversion bug on mobile
2018-05-02 07:43:22 -04:00
Paul Kaplan
0b849296c0
Merge pull request #268 from paulkaplan/fix-blurry-fullscreen
Scale the drawable scale by the ratio of pixel size to native size.
2018-05-02 07:43:07 -04:00
Paul Kaplan
085931cb4f Scale the drawable scale by the ratio of pixel size to native size.
This makes the vector sprites not blurry in fullscreen mode
2018-04-30 16:33:35 -04:00
Paul Kaplan
bd8ca26bb7 Fix color inversion bug on mobile 2018-04-30 15:54:13 -04:00
Mx Corey Frang
2b8371e5af
Rewrite isTouchingDrawables on CPU (#263)
* avoid gl.readPixels at all costs
2018-04-27 16:19:25 -04:00
DD
26f2039f39 We decided that it should not be the renderers responsibility to know a detail about how the paint editor works, and have the bitmap resolution passed in instead 2018-04-26 17:58:48 -04:00
DD Liu
d9c5b595a2
Merge pull request #264 from fsih/updateBitmap
Add updateBitmapSkin to renderer
2018-04-25 14:11:57 -04:00
DD
a49c455d9b Update bitmap 2018-04-24 17:01:59 -04:00
Karishma Chadha
ac1f5564a3 Bitmap (+ double resolution) support. 2018-04-22 21:30:28 -04:00
Karishma Chadha
1f574d6ee3 Provide an api to get the calulated rotation center from the rendered costume 2018-04-20 00:01:41 -04:00
Paul Kaplan
bbcf6f73d3 Add method for getting the size of a skin by skin id.
Renamed the `getSkinSize` method to `getCurrentSkinSize`, since it was
using the drawables current skin. Added a new `getSkinSize` method that
works by skin id.
2018-04-10 10:00:54 -04:00
Paul Kaplan
e02cc5ae03
Merge pull request #248 from paulkaplan/fix-bubble-bounds
Add "get bounds for bubble" method.
2018-03-23 14:35:52 -04:00