summaryrefslogtreecommitdiff
path: root/public/assets/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts')
-rw-r--r--public/assets/javascripts/mx/extensions/mx.movements.js5
-rw-r--r--public/assets/javascripts/rectangles/engine/sculpture/types/_object.js12
-rw-r--r--public/assets/javascripts/ui/editor/SculptureEditor.js31
3 files changed, 46 insertions, 2 deletions
diff --git a/public/assets/javascripts/mx/extensions/mx.movements.js b/public/assets/javascripts/mx/extensions/mx.movements.js
index bc71fc4..931caac 100644
--- a/public/assets/javascripts/mx/extensions/mx.movements.js
+++ b/public/assets/javascripts/mx/extensions/mx.movements.js
@@ -162,7 +162,10 @@ MX.Movements = function (cam) {
case 8: // backspace
e.preventDefault()
- if (app.controller.mediaEditor.scenery) {
+ if (app.controller.sculptureEditor.sculpture) {
+ app.controller.sculptureEditor.sculpture.remove()
+ }
+ else if (app.controller.mediaEditor.scenery) {
app.controller.mediaEditor.scenery.remove()
}
else if (app.controller.textEditor.scenery) {
diff --git a/public/assets/javascripts/rectangles/engine/sculpture/types/_object.js b/public/assets/javascripts/rectangles/engine/sculpture/types/_object.js
index 6c93b41..48fd96a 100644
--- a/public/assets/javascripts/rectangles/engine/sculpture/types/_object.js
+++ b/public/assets/javascripts/rectangles/engine/sculpture/types/_object.js
@@ -43,6 +43,18 @@ Sculpture.types.base = Fiber.extend(function(base){
this.move.unbind()
},
+ setOutline: function(val){
+ this.outline = val
+ // show/hide outline
+ },
+ setOutlineColor: function(val){
+ this.outlineColor = val
+ // set outline color
+ },
+ setBillboard: function(val){
+ this.billboard = val
+ },
+
remove: function(){
if (this.removed) return
this.removed = true
diff --git a/public/assets/javascripts/ui/editor/SculptureEditor.js b/public/assets/javascripts/ui/editor/SculptureEditor.js
index cce000e..ab0ccd2 100644
--- a/public/assets/javascripts/ui/editor/SculptureEditor.js
+++ b/public/assets/javascripts/ui/editor/SculptureEditor.js
@@ -10,12 +10,15 @@ var SculptureEditor = FormView.extend({
"mousedown": "stopPropagation",
"change [name=keyframe]": "seek",
"change [name=autoplay]": "setAutoplay",
+ "change [name=billboard]": "setBillboard",
+ "change [name=outline]": "setOutline",
+ "change [name=outlineColor]": "setOutlineColor",
"change [name=loop]": "setLoop",
"change [name=mute]": "setMute",
"change [name=width]": 'changeWidth',
"change [name=height]": 'changeHeight',
"change [name=units]": 'changeUnits',
- "click [data-role=destroy-media]": "destroy",
+ "click [data-role=destroy-sculpture]": "destroy",
},
initialize: function(opt){
@@ -25,6 +28,10 @@ var SculptureEditor = FormView.extend({
this.$name = this.$("[name=name]")
this.$description = this.$("[name=description]")
+ this.$billboard = this.$("[name=billboard]")
+ this.$outline = this.$("[name=outline]")
+ this.$outlineColor = this.$("[name=outlineColor]")
+
// image fields
this.$width = this.$("[name=width]")
this.$height = this.$("[name=height]")
@@ -71,6 +78,11 @@ var SculptureEditor = FormView.extend({
this.$description.val(media.description)
this.setDimensions()
this.$units.val( "ft" )
+
+ this.$outline.prop( 'checked', !! media.outline )
+ this.$outlineColor.val( media.outlineColor )
+ this.$billboard.prop( 'checked', !! media.billboard )
+
switch (media.type) {
case "image":
@@ -138,6 +150,23 @@ var SculptureEditor = FormView.extend({
this.tainted = true
},
+
+ setBillboard: function(){
+ var checked = this.$billboard.prop('checked')
+ this.sculpture.setBillboard(checked)
+ this.tainted = true
+ },
+ setOutline: function(){
+ var checked = this.$outline.prop('checked')
+ this.sculpture.setOutline(checked)
+ this.tainted = true
+ },
+ setOutlineColor: function(){
+ var color = this.$outlineColor.val()
+ this.sculpture.setOutlineColor(color)
+ this.tainted = true
+ },
+
setDimensions: function(){
if (! this.sculpture) return
this.$width.unitVal( Number(this.sculpture.naturalDimensions.a * this.sculpture.scale) || "" )