本文整理了Java中pythagoras.f.Point.<init>()
方法的一些代码示例,展示了Point.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.<init>()
方法的具体详情如下:
包路径:pythagoras.f.Point
类名称:Point
方法名:<init>
[英]Constructs a point at (0, 0).
[中]在(0,0)处构造一个点。
代码示例来源:origin: playn/playn
public void onEmit (Keyboard.Event event) {
if (event instanceof Keyboard.KeyEvent) {
Keyboard.KeyEvent kevent = (Keyboard.KeyEvent)event;
if (kevent.key == pivotKey && kevent.down) {
pivot = new Point(x, y);
}
}
}
});
代码示例来源:origin: io.playn/playn-java-base
public void onEmit (Keyboard.Event event) {
if (event instanceof Keyboard.KeyEvent) {
Keyboard.KeyEvent kevent = (Keyboard.KeyEvent)event;
if (kevent.key == pivotKey && kevent.down) {
pivot = new Point(x, y);
}
}
}
});
代码示例来源:origin: threerings/tripleplay
public TextureData (DataInputStream istream) throws IOException {
symbol = istream.readUTF();
origin = new Point(istream.readFloat(), istream.readFloat());
rect = new float[] { istream.readFloat(), istream.readFloat(), istream.readFloat(),
istream.readFloat() };
}
代码示例来源:origin: playn/playn
/**
* Converts the supplied point from coordinates relative to the specified
* layer to screen coordinates.
*/
public static Point layerToScreen(Layer layer, float x, float y) {
Point into = new Point(x, y);
return layerToScreen(layer, into, into);
}
代码示例来源:origin: playn/playn
/**
* Converts the supplied point from coordinates relative to the specified
* child layer to coordinates relative to the specified parent layer.
*/
public static Point layerToParent(Layer layer, Layer parent, float x, float y) {
Point into = new Point(x, y);
return layerToParent(layer, parent, into, into);
}
代码示例来源:origin: threerings/playn
/**
* Converts the supplied point from screen coordinates to coordinates
* relative to the specified layer.
*/
public static Point screenToLayer(Layer layer, float x, float y) {
Point into = new Point(x, y);
return screenToLayer(layer, into, into);
}
代码示例来源:origin: playn/playn
/**
* Converts the supplied point from screen coordinates to coordinates
* relative to the specified layer.
*/
public static Point screenToLayer(Layer layer, float x, float y) {
Point into = new Point(x, y);
return screenToLayer(layer, into, into);
}
代码示例来源:origin: com.samskivert/pythagoras
/**
* Computes and returns the point inside the bounds of the rectangle that's closest to the
* given point.
*/
public static Point closestInteriorPoint (IRectangle r, IPoint p) {
return closestInteriorPoint(r, p, new Point());
}
代码示例来源:origin: threerings/tripleplay
/**
* Positions {@code elem} at the specified position, in its preferred size.
*/
public static <T extends Element<?>> T at (T elem, float x, float y) {
return at(elem, new Point(x, y));
}
代码示例来源:origin: threerings/playn
/**
* Converts the supplied point from coordinates relative to the specified
* layer to screen coordinates.
*/
public static Point layerToScreen(Layer layer, float x, float y) {
Point into = new Point(x, y);
return layerToScreen(layer, into, into);
}
代码示例来源:origin: threerings/playn
/**
* Converts the supplied point from coordinates relative to the specified
* child layer to coordinates relative to the specified parent layer.
*/
public static Point layerToParent(Layer layer, Layer parent, float x, float y) {
Point into = new Point(x, y);
return layerToParent(layer, parent, into, into);
}
代码示例来源:origin: threerings/tripleplay
/**
* Parses custom float[][] array generated the {@code FramePacker} tool.
*/
protected static Frame[] parseFrames (float[][] meta) {
Frame[] frames = new Frame[(meta.length-1)/2];
for (int ii = 0, mm = 1; ii < frames.length; ii++) {
frames[ii] = new Frame(new Point(meta[mm][0], meta[mm++][1]),
new Rectangle(meta[mm][0], meta[mm][1],
meta[mm][2], meta[mm++][3]));
}
return frames;
}
代码示例来源:origin: com.samskivert/pythagoras
@Override // from IRectangularShape
public Point min ()
{
return new Point(minX(), minY());
}
代码示例来源:origin: com.samskivert/pythagoras
@Override // from IRectangularShape
public Point max ()
{
return new Point(maxX(), maxY());
}
代码示例来源:origin: threerings/tripleplay
/**
* Constrains {@code elem} to the specified position and size.
*/
public static <T extends Element<?>> T at (T elem, float x, float y, float width, float height) {
return at(elem, new Point(x, y), new Dimension(width, height));
}
代码示例来源:origin: samskivert/pythagoras
@Override // from IRectangularShape
public Point min ()
{
return new Point(minX(), minY());
}
代码示例来源:origin: samskivert/pythagoras
@Override // from IRectangularShape
public Point center ()
{
return new Point(centerX(), centerY());
}
代码示例来源:origin: com.samskivert/pythagoras
@Override // from IRectangularShape
public Point center ()
{
return new Point(centerX(), centerY());
}
代码示例来源:origin: threerings/tripleplay
/**
* Computes the total bounds of the layer hierarchy rooted at {@code root}.
* The returned Rectangle will be in {@code root}'s coordinate system.
*/
public static Rectangle totalBounds (Layer root) {
// account for root's origin
Rectangle r = new Rectangle(root.originX(), root.originY(), 0, 0);
addBounds(root, root, r, new Point());
return r;
}
代码示例来源:origin: threerings/tripleplay
@Override public void handleEvent (Event event) {
if (event.widget == _platform.graphics().canvas() &&
(_kfc == null || _kfc.unfocusForLocation(new Point(event.x, event.y)))) {
clearFocus();
}
}
});
内容来源于网络,如有侵权,请联系作者删除!