mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-07-16 17:22:21 -04:00
Merge remote-tracking branch 'refs/remotes/LLK/develop' into feature/fencing
This commit is contained in:
commit
1a3e9845d0
5 changed files with 22 additions and 28 deletions
|
@ -2,8 +2,7 @@
|
||||||
#### WebGL-based rendering engine for Scratch 3.0
|
#### WebGL-based rendering engine for Scratch 3.0
|
||||||
|
|
||||||
[](https://travis-ci.org/LLK/scratch-render)
|
[](https://travis-ci.org/LLK/scratch-render)
|
||||||
[](https://david-dm.org/LLK/scratch-render)
|
[](https://greenkeeper.io/)
|
||||||
[](https://david-dm.org/LLK/scratch-render#info=devDependencies)
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
```bash
|
```bash
|
||||||
|
|
22
package.json
22
package.json
|
@ -21,26 +21,26 @@
|
||||||
"watch": "./node_modules/.bin/webpack --progress --colors --watch --watch-poll"
|
"watch": "./node_modules/.bin/webpack --progress --colors --watch --watch-poll"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "6.9.1",
|
"babel-core": "6.22.1",
|
||||||
"babel-eslint": "7.1.1",
|
"babel-eslint": "7.1.1",
|
||||||
"babel-loader": "6.2.4",
|
"babel-loader": "6.2.10",
|
||||||
"babel-polyfill": "6.9.1",
|
"babel-polyfill": "6.22.0",
|
||||||
"babel-preset-es2015": "6.9.0",
|
"babel-preset-es2015": "6.22.0",
|
||||||
"base64-loader": "1.0.0",
|
"base64-loader": "1.0.0",
|
||||||
"eslint": "3.12.0",
|
"eslint": "3.14.1",
|
||||||
"eslint-config-scratch": "3.1.0",
|
"eslint-config-scratch": "3.1.0",
|
||||||
"gh-pages": "0.11.0",
|
"gh-pages": "0.12.0",
|
||||||
"hull.js": "0.2.10",
|
"hull.js": "0.2.10",
|
||||||
"json": "9.0.4",
|
"json": "9.0.4",
|
||||||
"json-loader": "0.5.4",
|
"json-loader": "0.5.4",
|
||||||
"lodash.defaultsdeep": "4.6.0",
|
"lodash.defaultsdeep": "4.6.0",
|
||||||
"raw-loader": "0.5.1",
|
"raw-loader": "0.5.1",
|
||||||
"scratch-render-fonts": "git+https://github.com/LLK/scratch-render-fonts.git",
|
"scratch-render-fonts": "git+https://github.com/LLK/scratch-render-fonts.git",
|
||||||
"tap": "5.7.1",
|
"tap": "10.0.1",
|
||||||
"travis-after-all": "1.4.4",
|
"travis-after-all": "1.4.4",
|
||||||
"twgl.js": "1.5.2",
|
"twgl.js": "2.8.2",
|
||||||
"webpack": "1.13.0",
|
"webpack": "2.2.1",
|
||||||
"webpack-dev-server": "1.14.1",
|
"webpack-dev-server": "1.16.3",
|
||||||
"xhr": "2.2.0"
|
"xhr": "2.3.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,7 +181,7 @@ class PenSkin extends Skin {
|
||||||
const r = Math.round(color4f[0] * 255);
|
const r = Math.round(color4f[0] * 255);
|
||||||
const g = Math.round(color4f[1] * 255);
|
const g = Math.round(color4f[1] * 255);
|
||||||
const b = Math.round(color4f[2] * 255);
|
const b = Math.round(color4f[2] * 255);
|
||||||
const a = Math.round(color4f[3]); // Alpha is 0 to 1 (not 0 to 255 like r,g,b)
|
const a = color4f[3]; // Alpha is 0 to 1 (not 0 to 255 like r,g,b)
|
||||||
|
|
||||||
context.strokeStyle = `rgba(${r},${g},${b},${a})`;
|
context.strokeStyle = `rgba(${r},${g},${b},${a})`;
|
||||||
context.lineCap = 'round';
|
context.lineCap = 'round';
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
// First, have Webpack load their data as Base 64 strings.
|
// First, have Webpack load their data as Base 64 strings.
|
||||||
/* eslint-disable global-require */
|
/* eslint-disable global-require */
|
||||||
const FONTS = {
|
const FONTS = {
|
||||||
Donegal: require('base64!scratch-render-fonts/DonegalOne-Regular.ttf'),
|
Donegal: require('base64-loader!scratch-render-fonts/DonegalOne-Regular.ttf'),
|
||||||
Gloria: require('base64!scratch-render-fonts/GloriaHallelujah.ttf'),
|
Gloria: require('base64-loader!scratch-render-fonts/GloriaHallelujah.ttf'),
|
||||||
Mystery: require('base64!scratch-render-fonts/MysteryQuest-Regular.ttf'),
|
Mystery: require('base64-loader!scratch-render-fonts/MysteryQuest-Regular.ttf'),
|
||||||
Marker: require('base64!scratch-render-fonts/PermanentMarker.ttf'),
|
Marker: require('base64-loader!scratch-render-fonts/PermanentMarker.ttf'),
|
||||||
Scratch: require('base64!scratch-render-fonts/Scratch.ttf')
|
Scratch: require('base64-loader!scratch-render-fonts/Scratch.ttf')
|
||||||
};
|
};
|
||||||
/* eslint-enable global-require */
|
/* eslint-enable global-require */
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ class SvgRenderer {
|
||||||
constructor (canvas) {
|
constructor (canvas) {
|
||||||
this._canvas = canvas || document.createElement('canvas');
|
this._canvas = canvas || document.createElement('canvas');
|
||||||
this._context = this._canvas.getContext('2d');
|
this._context = this._canvas.getContext('2d');
|
||||||
|
this._measurements = {x: 0, y: 0, width: 0, height: 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,21 +15,17 @@ const base = {
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
rules: [
|
||||||
{
|
{
|
||||||
include: [
|
include: [
|
||||||
path.resolve(__dirname, 'src')
|
path.resolve(__dirname, 'src')
|
||||||
],
|
],
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
query: {
|
options: {
|
||||||
presets: ['es2015']
|
presets: ['es2015']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
test: /\.json$/,
|
|
||||||
loader: 'json-loader'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
test: /\.(glsl|vs|fs|frag|vert)$/,
|
test: /\.(glsl|vs|fs|frag|vert)$/,
|
||||||
loader: 'raw-loader'
|
loader: 'raw-loader'
|
||||||
|
@ -40,9 +36,7 @@ const base = {
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
include: /\.min\.js$/,
|
include: /\.min\.js$/,
|
||||||
minimize: true,
|
minimize: true,
|
||||||
compress: {
|
sourceMap: true
|
||||||
warnings: false
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue