OSDN Git Service

toCSS メソッドを追加
[flapp/flapp.git] / src / display.js
1 goog.provide('FlappDisplay');
2
3 goog.scope(function () {
4
5 /**
6  * @constructor
7  */
8 FlappDisplay = function() {
9     this.objs = {};
10 };
11
12 FlappDisplay.prototype = {
13     set: function(depth, obj, place) {
14         this.objs[depth] = obj;
15         obj.matrix = place.matrix;
16         obj.colorTransform = place.colorTransform;
17         obj.clipDepth = place.clipDepth;
18         console.log('this.objs');
19         console.log(this.objs);
20     },
21     move: function(depth, place) 
22     {
23         var obj = this.objs[depth];
24         if (place.matrix) {
25             obj.matrix = place.matrix;
26         }
27         if (place.colorTransform) {
28             obj.colorTransform = place.colorTransform;
29         }
30     },
31     get: function(depth) {
32 //      console.debug("get: depth:"+depth);
33 //      console.debug(this.objs);
34         return this.objs[depth];
35     },
36     del: function(depth) {
37         this.objs[depth].destroy();
38         delete this.objs[depth];
39     },
40     descSortedDepth: function() {
41         var keys = Object.keys(this.objs);
42         return keys.sort(
43             function(a,b) { return (a>b)?-1:((a<b)?1:0); }
44         );
45     }
46 };
47
48 });