public class ImageSceneObject extends SceneObject
SceneObject
that consists of an image. The default origin is set to Point(0,0). The
size is set to the image's size. The image will be scaled to fit the size of this object.ORIGIN_TOP_LEFT
Constructor and Description |
---|
ImageSceneObject(BufferedImage image)
Create a new
SceneObject that displays an image. |
ImageSceneObject(Image image) |
Modifier and Type | Method and Description |
---|---|
BufferedImage |
getImage() |
Point |
getOrigin()
The origin of this
SceneObject . |
protected void |
paint(Graphics2D g,
long elapsedTime)
Paint this SceneObject.
|
void |
setImage(BufferedImage image) |
collides, collidesBoundingBox, collidesExactly, consumes, consumesBoundingBox, consumesExactly, getHeight, getPosition, getPreciseHeight, getPreciseWidth, getPreciseX, getPreciseY, getRectangle, getRenderingOptions, getSize, getTopLeftPosition, getWidth, getX, getY, isDrawBoundingBox, paintAbsoluteOnScene, paintOnScene, paintOnScene, paintOnScene, paintOnScene, setDrawBoundingBox, setPosition, setPosition, setRenderingOptions, setSize, setSize, setTopLeftPosition
public ImageSceneObject(Image image)
ImageSceneObject(BufferedImage)
public ImageSceneObject(BufferedImage image)
SceneObject
that displays an image. The origin is set to P(0,0). The
size is set to the image's size.image
- Shown imageprotected void paint(Graphics2D g, long elapsedTime)
SceneObject
SceneObject
it is
important, that the object is drawn in it's actual state.paint
in class SceneObject
g
- Graphics Object for paintingelapsedTime
- Elapsed time since the last call to this methodpublic Point getOrigin()
SceneObject
SceneObject
. This object's position will be
translated to it's origin. The default implementation returns
SceneObject.ORIGIN_TOP_LEFT
getOrigin
in class SceneObject
public BufferedImage getImage()
public void setImage(BufferedImage image)
Copyright © 2017. All rights reserved.