save stage's background color in project

also save alpha of pen color and background color
pull/89/head
jmoenig 2019-01-23 17:34:51 +01:00
rodzic 8bf326e934
commit 2cc9a17310
3 zmienionych plików z 14 dodań i 4 usunięć

Wyświetl plik

@ -32,6 +32,7 @@
### 2019-01-23
* Objects, Threads: new blocks for setting and changing the stage's background color
* Store: save stage's background color in project
* Blocks: Tweaked rendering of C-shaped slots in predicates
* updated cases library blocks with new loop-arrow symbols
* updated animation library blocks with new loop-arrow symbols, tweaked FOR block

Wyświetl plik

@ -17,7 +17,7 @@
<script type="text/javascript" src="src/symbols.js?version=2019-01-14"></script>
<script type="text/javascript" src="src/sketch.js?version=2018-10-02"></script>
<script type="text/javascript" src="src/xml.js?version=2018-11-12"></script>
<script type="text/javascript" src="src/store.js?version=2019-01-14"></script>
<script type="text/javascript" src="src/store.js?version=2019-01-23"></script>
<script type="text/javascript" src="src/locale.js?version=2019-01-21"></script>
<script type="text/javascript" src="src/cloud.js?version=2019-01-17"></script>
<script type="text/javascript" src="src/sha512.js?version=2018-10-02"></script>

Wyświetl plik

@ -61,7 +61,7 @@ normalizeCanvas, contains*/
// Global stuff ////////////////////////////////////////////////////////
modules.store = '2019-January-14';
modules.store = '2019-January-23';
// XML_Serializer ///////////////////////////////////////////////////////
@ -386,6 +386,10 @@ SnapSerializer.prototype.rawLoadProjectModel = function (xmlNode, remixID) {
if (model.stage.attributes.name) {
project.stage.name = model.stage.attributes.name;
}
if (model.stage.attributes.color) {
project.stage.color = this.loadColor(model.stage.attributes.color);
project.stage.cachedHSV = project.stage.color.hsv();
}
if (model.stage.attributes.scheduled === 'true') {
project.stage.fps = 30;
StageMorph.prototype.frameRate = 30;
@ -1657,7 +1661,7 @@ StageMorph.prototype.toXML = function (serializer) {
'<notes>$</notes>' +
'<thumbnail>$</thumbnail>' +
'<stage name="@" width="@" height="@" ' +
'costume="@" tempo="@" threadsafe="@" ' +
'costume="@" color="@,@,@,@" tempo="@" threadsafe="@" ' +
'%' +
'lines="@" ' +
'ternary="@" ' +
@ -1687,6 +1691,10 @@ StageMorph.prototype.toXML = function (serializer) {
StageMorph.prototype.dimensions.x,
StageMorph.prototype.dimensions.y,
this.getCostumeIdx(),
this.color.r,
this.color.g,
this.color.b,
this.color.a,
this.getTempo(),
this.isThreadSafe,
this.instrument ?
@ -1732,7 +1740,7 @@ SpriteMorph.prototype.toXML = function (serializer) {
'%' +
' draggable="@"' +
'%' +
' costume="@" color="@,@,@" pen="@" ~>' +
' costume="@" color="@,@,@,@" pen="@" ~>' +
'%' + // inheritance info
'%' + // nesting info
(noCostumes ? '%' : '<costumes>%</costumes>') +
@ -1757,6 +1765,7 @@ SpriteMorph.prototype.toXML = function (serializer) {
this.color.r,
this.color.g,
this.color.b,
this.color.a,
this.penPoint,
// inheritance info