Project

General

Profile

« Previous | Next » 

Revision f988589e

Added by Leszek Koltunski almost 8 years ago

Further reduce the distortedObject's API - now only 26 methods, 1/4 of the 104 before the reorganization.

View differences:

src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java
30 30
import org.distorted.library.Distorted;
31 31
import org.distorted.library.DistortedBitmap;
32 32
import org.distorted.library.EffectTypes;
33
import org.distorted.library.type.Dynamic2D;
34 33
import org.distorted.library.type.Dynamic3D;
35 34
import org.distorted.library.type.Static1D;
36 35
import org.distorted.library.type.Static2D;
......
62 61
      mView = v;
63 62
     
64 63
      // create shared effects - enlarge the nose and keep moving the whole bitmap left and right.
65
      dDistort = new Dynamic3D();
66
      dDistort.setCount(0.0f);
67
      dDistort.setDuration(3000);
64
      dDistort = new Dynamic3D(3000,0.0f);
68 65
      vec = new Static3D[2];
69 66
      vec[0] = new Static3D( 25,0,0);
70 67
      vec[1] = new Static3D(-25,0,0);
......
121 118
        {
122 119
        int w = (height*bmpWidth)/bmpHeight;
123 120
        float factor = (float)height/bmpHeight;
124
        Static3D scale = new Static3D(factor,factor,factor);
125 121

  
126 122
        for(int i=NUM-1; i>=0; i--) 
127 123
          {
128 124
          bmp[i].move( new Static3D((width-NUM*w)/2 +i*w ,0,0) );
129
          bmp[i].scale(scale);
125
          bmp[i].scale(factor);
130 126
          }
131 127
        }
132 128
      else
......
134 130
        int w = width/NUM;  
135 131
        int h = (width*bmpHeight)/(bmpWidth*NUM);
136 132
        float factor = (float)width/(bmpWidth*NUM);
137
        Static3D scale = new Static3D(factor,factor,factor);
138 133

  
139 134
        for(int i=NUM-1; i>=0; i--) 
140 135
          {
141 136
          bmp[i].move( new Static3D(i*w,(height-h)/2,0) );
142
          bmp[i].scale(scale);
137
          bmp[i].scale(factor);
143 138
          }
144 139
        }
145 140
         

Also available in: Unified diff