예제 #1
0
        public MainItemVO(MainItemVO vo)
        {
            uniqueId       = vo.uniqueId;
            itemIdentifier = vo.itemIdentifier;
            itemName       = vo.itemName;
            if (tags != null)
            {
                tags = (string[])vo.tags.Clone();
            }
            customVars = vo.customVars;
            x          = vo.x;
            y          = vo.y;
            rotation   = vo.rotation;
            zIndex     = vo.zIndex;
            layerName  = vo.layerName;
            if (vo.tint != null)
            {
                tint = (float[])vo.tint.Clone();
            }
            scaleX  = vo.scaleX;
            scaleY  = vo.scaleY;
            originX = vo.originX;
            originY = vo.originY;

            if (vo.shape != null)
            {
                shape = vo.shape.clone();
            }

            if (vo.physics != null)
            {
                physics = new PhysicsBodyDataVO(vo.physics);
            }
        }
예제 #2
0
        public MainItemVO(MainItemVO vo)
        {
            uniqueId = vo.uniqueId;
            itemIdentifier = vo.itemIdentifier;
            itemName = vo.itemName;
            if (tags != null)
                tags = (string[])vo.tags.Clone();
            customVars = vo.customVars;
            x = vo.x;
            y = vo.y;
            rotation = vo.rotation;
            zIndex = vo.zIndex;
            layerName = vo.layerName;
            if(vo.tint != null) tint = (float[])vo.tint.Clone();
            scaleX 		= vo.scaleX;
            scaleY 		= vo.scaleY;
            originX 	= vo.originX;
            originY 	= vo.originY;

            if(vo.shape != null) {
                shape = vo.shape.clone();
            }

            if(vo.physics != null){
                physics = new PhysicsBodyDataVO(vo.physics);
            }
        }
예제 #3
0
        public static ShapeVO createRect(float width, float height)
        {
            ShapeVO vo = new ShapeVO();
            vo.polygons = new Vector2[1][];

            vo.polygons[0] = new Vector2[4];
            vo.polygons[0][0] = new Vector2(0, 0);
            vo.polygons[0][1] = new Vector2(0, height);
            vo.polygons[0][2] = new Vector2(width, height);
            vo.polygons[0][3] = new Vector2(width, 0);

            return vo;
        }
예제 #4
0
        public static ShapeVO createRect(float width, float height)
        {
            ShapeVO vo = new ShapeVO();

            vo.polygons = new Vector2[1][];

            vo.polygons[0]    = new Vector2[4];
            vo.polygons[0][0] = new Vector2(0, 0);
            vo.polygons[0][1] = new Vector2(0, height);
            vo.polygons[0][2] = new Vector2(width, height);
            vo.polygons[0][3] = new Vector2(width, 0);

            return(vo);
        }
예제 #5
0
        public ShapeVO clone()
        {
            ShapeVO newVo = new ShapeVO();
            Vector2 [][] target = new Vector2[polygons.Length][];

            for (int i = 0; i < polygons.Length; i++) {
                target[i] = new Vector2[polygons[i].Length];
                for(int j=0;j<polygons[i].Length;j++){
                    target[i][j] = polygons[i][j];
                }
            }
            newVo.polygons = target;

            return newVo;
        }
예제 #6
0
        public ShapeVO clone()
        {
            ShapeVO newVo = new ShapeVO();

            Vector2 [][] target = new Vector2[polygons.Length][];

            for (int i = 0; i < polygons.Length; i++)
            {
                target[i] = new Vector2[polygons[i].Length];
                for (int j = 0; j < polygons[i].Length; j++)
                {
                    target[i][j] = polygons[i][j];
                }
            }
            newVo.polygons = target;

            return(newVo);
        }