pythagoras.f.Point.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中pythagoras.f.Point.<init>()方法的一些代码示例,展示了Point.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.<init>()方法的具体详情如下:
包路径:pythagoras.f.Point
类名称:Point
方法名:<init>

Point.<init>介绍

[英]Constructs a point at (0, 0).
[中]在(0,0)处构造一个点。

代码示例

代码示例来源:origin: playn/playn

  1. public void onEmit (Keyboard.Event event) {
  2. if (event instanceof Keyboard.KeyEvent) {
  3. Keyboard.KeyEvent kevent = (Keyboard.KeyEvent)event;
  4. if (kevent.key == pivotKey && kevent.down) {
  5. pivot = new Point(x, y);
  6. }
  7. }
  8. }
  9. });

代码示例来源:origin: io.playn/playn-java-base

  1. public void onEmit (Keyboard.Event event) {
  2. if (event instanceof Keyboard.KeyEvent) {
  3. Keyboard.KeyEvent kevent = (Keyboard.KeyEvent)event;
  4. if (kevent.key == pivotKey && kevent.down) {
  5. pivot = new Point(x, y);
  6. }
  7. }
  8. }
  9. });

代码示例来源:origin: threerings/tripleplay

  1. public TextureData (DataInputStream istream) throws IOException {
  2. symbol = istream.readUTF();
  3. origin = new Point(istream.readFloat(), istream.readFloat());
  4. rect = new float[] { istream.readFloat(), istream.readFloat(), istream.readFloat(),
  5. istream.readFloat() };
  6. }

代码示例来源:origin: playn/playn

  1. /**
  2. * Converts the supplied point from coordinates relative to the specified
  3. * layer to screen coordinates.
  4. */
  5. public static Point layerToScreen(Layer layer, float x, float y) {
  6. Point into = new Point(x, y);
  7. return layerToScreen(layer, into, into);
  8. }

代码示例来源:origin: playn/playn

  1. /**
  2. * Converts the supplied point from coordinates relative to the specified
  3. * child layer to coordinates relative to the specified parent layer.
  4. */
  5. public static Point layerToParent(Layer layer, Layer parent, float x, float y) {
  6. Point into = new Point(x, y);
  7. return layerToParent(layer, parent, into, into);
  8. }

代码示例来源:origin: threerings/playn

  1. /**
  2. * Converts the supplied point from screen coordinates to coordinates
  3. * relative to the specified layer.
  4. */
  5. public static Point screenToLayer(Layer layer, float x, float y) {
  6. Point into = new Point(x, y);
  7. return screenToLayer(layer, into, into);
  8. }

代码示例来源:origin: playn/playn

  1. /**
  2. * Converts the supplied point from screen coordinates to coordinates
  3. * relative to the specified layer.
  4. */
  5. public static Point screenToLayer(Layer layer, float x, float y) {
  6. Point into = new Point(x, y);
  7. return screenToLayer(layer, into, into);
  8. }

代码示例来源:origin: com.samskivert/pythagoras

  1. /**
  2. * Computes and returns the point inside the bounds of the rectangle that's closest to the
  3. * given point.
  4. */
  5. public static Point closestInteriorPoint (IRectangle r, IPoint p) {
  6. return closestInteriorPoint(r, p, new Point());
  7. }

代码示例来源:origin: threerings/tripleplay

  1. /**
  2. * Positions {@code elem} at the specified position, in its preferred size.
  3. */
  4. public static <T extends Element<?>> T at (T elem, float x, float y) {
  5. return at(elem, new Point(x, y));
  6. }

代码示例来源:origin: threerings/playn

  1. /**
  2. * Converts the supplied point from coordinates relative to the specified
  3. * layer to screen coordinates.
  4. */
  5. public static Point layerToScreen(Layer layer, float x, float y) {
  6. Point into = new Point(x, y);
  7. return layerToScreen(layer, into, into);
  8. }

代码示例来源:origin: threerings/playn

  1. /**
  2. * Converts the supplied point from coordinates relative to the specified
  3. * child layer to coordinates relative to the specified parent layer.
  4. */
  5. public static Point layerToParent(Layer layer, Layer parent, float x, float y) {
  6. Point into = new Point(x, y);
  7. return layerToParent(layer, parent, into, into);
  8. }

代码示例来源:origin: threerings/tripleplay

  1. /**
  2. * Parses custom float[][] array generated the {@code FramePacker} tool.
  3. */
  4. protected static Frame[] parseFrames (float[][] meta) {
  5. Frame[] frames = new Frame[(meta.length-1)/2];
  6. for (int ii = 0, mm = 1; ii < frames.length; ii++) {
  7. frames[ii] = new Frame(new Point(meta[mm][0], meta[mm++][1]),
  8. new Rectangle(meta[mm][0], meta[mm][1],
  9. meta[mm][2], meta[mm++][3]));
  10. }
  11. return frames;
  12. }

代码示例来源:origin: com.samskivert/pythagoras

  1. @Override // from IRectangularShape
  2. public Point min ()
  3. {
  4. return new Point(minX(), minY());
  5. }

代码示例来源:origin: com.samskivert/pythagoras

  1. @Override // from IRectangularShape
  2. public Point max ()
  3. {
  4. return new Point(maxX(), maxY());
  5. }

代码示例来源:origin: threerings/tripleplay

  1. /**
  2. * Constrains {@code elem} to the specified position and size.
  3. */
  4. public static <T extends Element<?>> T at (T elem, float x, float y, float width, float height) {
  5. return at(elem, new Point(x, y), new Dimension(width, height));
  6. }

代码示例来源:origin: samskivert/pythagoras

  1. @Override // from IRectangularShape
  2. public Point min ()
  3. {
  4. return new Point(minX(), minY());
  5. }

代码示例来源:origin: samskivert/pythagoras

  1. @Override // from IRectangularShape
  2. public Point center ()
  3. {
  4. return new Point(centerX(), centerY());
  5. }

代码示例来源:origin: com.samskivert/pythagoras

  1. @Override // from IRectangularShape
  2. public Point center ()
  3. {
  4. return new Point(centerX(), centerY());
  5. }

代码示例来源:origin: threerings/tripleplay

  1. /**
  2. * Computes the total bounds of the layer hierarchy rooted at {@code root}.
  3. * The returned Rectangle will be in {@code root}'s coordinate system.
  4. */
  5. public static Rectangle totalBounds (Layer root) {
  6. // account for root's origin
  7. Rectangle r = new Rectangle(root.originX(), root.originY(), 0, 0);
  8. addBounds(root, root, r, new Point());
  9. return r;
  10. }

代码示例来源:origin: threerings/tripleplay

  1. @Override public void handleEvent (Event event) {
  2. if (event.widget == _platform.graphics().canvas() &&
  3. (_kfc == null || _kfc.unfocusForLocation(new Point(event.x, event.y)))) {
  4. clearFocus();
  5. }
  6. }
  7. });

相关文章