All Downloads are FREE. Search and download functionalities are using the official Maven repository.

playn.core.Path Maven / Gradle / Ivy

/**
 * Copyright 2010 The PlayN Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package playn.core;

/**
 * A path object created by {@link Graphics#createPath()}.
 */
public interface Path {

  /**
   * Resets the current path, removing all strokes and moving the position to
   * (0, 0).
   */
  void reset();

  /**
   * Closes the path, returning the position to the beginning of the first
   * stroke.
   */
  void close();

  /**
   * Moves the position to the given location.
   */
  void moveTo(float x, float y);

  /**
   * Adds a line to the path, from the current position to the specified target.
   */
  void lineTo(float x, float y);

  /**
   * Adds a quadratic curve to the path, from the current position to the
   * specified target, with the specified control point.
   */
  void quadraticCurveTo(float cpx, float cpy, float x, float y);

  /**
   * Adds an arc to the path, from the current position to the specified target,
   * with the specified radius.
   */
  void arcTo(float radius, float x, float y);

  // TODO(jgw): fill rules (HTML Canvas doesn't seem to have anything)
  // Android has [inverse] winding, even-odd
  // Flash has even-odd, non-zero
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy