public interface Image extends Resource, Shape, Renderable
Example:
// Load final Image image = Drawable.loadImage(Medias.create("image.png")); image.setPosition(10, 50); // Render image.render(g);
Modifier and Type | Method and Description |
---|---|
ImageBuffer |
getSurface()
Get the surface which represents the image.
|
void |
load()
Load surface.
|
void |
prepare()
Prepare loaded surface to be displayed.
|
void |
setLocation(double x,
double y)
Set the location on screen.
|
void |
setLocation(Viewer viewer,
Localizable localizable)
Set the location on screen from a viewer viewpoint.
|
void |
setOrigin(Origin origin)
Set the origin location type, related to surface area.
|
getX, getY
render
void load()
Must be called only one time. prepare()
must be then called.
Images loaded with a reference of an existing ImageBuffer
(such as
Drawable.loadImage(ImageBuffer)
) must not call this function, as surface as already been loaded and is
shared.
load
in interface Resource
LionEngineException
- If an error occurred when reading the image or already loaded.void prepare()
load()
. It will
prepare memory data to be displayed.LionEngineException
- If error on preparing.void setOrigin(Origin origin)
origin
- The origin typevoid setLocation(double x, double y)
x
- The horizontal location.y
- The vertical location.void setLocation(Viewer viewer, Localizable localizable)
viewer
- The viewer reference.localizable
- The localizable reference.ImageBuffer getSurface()
null
if not loaded).Copyright © 2016 Byron 3D Games Studio. All rights reserved.