Exemplo n.º 1
0
 void readCurve(CurveTimeline timeline, int frameIndex, JsonValue valueMap) {
   JsonValue curve = valueMap.get("curve");
   if (curve == null) return;
   if (curve.isString() && curve.asString().equals("stepped")) timeline.setStepped(frameIndex);
   else if (curve.isArray()) {
     timeline.setCurve(
         frameIndex, curve.getFloat(0), curve.getFloat(1), curve.getFloat(2), curve.getFloat(3));
   }
 }
 private void readCurve(DataInput input, int frameIndex, CurveTimeline timeline)
     throws IOException {
   switch (input.readByte()) {
     case CURVE_STEPPED:
       timeline.setStepped(frameIndex);
       break;
     case CURVE_BEZIER:
       setCurve(
           timeline,
           frameIndex,
           input.readFloat(),
           input.readFloat(),
           input.readFloat(),
           input.readFloat());
       break;
   }
 }
 void setCurve(
     CurveTimeline timeline, int frameIndex, float cx1, float cy1, float cx2, float cy2) {
   timeline.setCurve(frameIndex, cx1, cy1, cx2, cy2);
 }