Package dev.cerus.maps.api.graphics
Class MapScreenGraphics
java.lang.Object
dev.cerus.maps.api.graphics.MapGraphics<MapScreen,ClientsideMap[][]>
dev.cerus.maps.api.graphics.MapScreenGraphics
Graphics implementation for map screens
Uses clientside map graphics under the hood
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Make a copy of this buffervoidfillComplete(byte color)Fills the whole buffer with a specific colorintGet the height in pixels of this bufferbytegetPixel(int x, int y)Get a pixelintgetWidth()Get the width in pixels of this buffervoidrenderOnto(MapScreen renderTarget, ClientsideMap[][] array)Basically copies this buffer onto the buffer of the specified render targetbytesetPixel(int x, int y, float alpha, byte color)Set a pixelMethods inherited from class dev.cerus.maps.api.graphics.MapGraphics
applyFilterToArea, boxBlur, boxBlur, boxBlur, boxBlur, calculateComposite, composite, compositeAtop, compositeIn, compositeOut, compositeOver, compositeXor, drawEllipse, drawEllipse, drawImage, drawLine, drawLine, drawLineX, drawLineY, drawRect, drawText, drawText, fill, fillRect, fillWithBuffer, getDirectAccessData, grayscale, hasDirectAccessCapabilities, index, index, isTransparent, newGraphicsObject, normalizeAlpha, place, place, place, renderOnto, replace, setPixel, standalone
-
Constructor Details
-
MapScreenGraphics
public MapScreenGraphics(int w, int h)
-
-
Method Details
-
fillComplete
public void fillComplete(byte color)Description copied from class:MapGraphicsFills the whole buffer with a specific color- Overrides:
fillCompletein classMapGraphics<MapScreen,ClientsideMap[][]>- Parameters:
color- The color to fill the buffer with
-
setPixel
public byte setPixel(int x, int y, float alpha, byte color)Description copied from class:MapGraphicsSet a pixel- Specified by:
setPixelin classMapGraphics<MapScreen,ClientsideMap[][]>- Parameters:
x- The x coordinatey- The y coordinatealpha- The pixel alphacolor- The pixel color- Returns:
- The old pixel color. Might return the specified color if the method does not end up setting the pixel.
-
getPixel
public byte getPixel(int x, int y)Description copied from class:MapGraphicsGet a pixel- Specified by:
getPixelin classMapGraphics<MapScreen,ClientsideMap[][]>- Parameters:
x- The x coordinatey- The y coordinate- Returns:
- The pixels color
-
renderOnto
Description copied from class:MapGraphicsBasically copies this buffer onto the buffer of the specified render target- Specified by:
renderOntoin classMapGraphics<MapScreen,ClientsideMap[][]>- Parameters:
renderTarget- The render targetarray- The render parameters
-
copy
Description copied from class:MapGraphicsMake a copy of this buffer- Specified by:
copyin classMapGraphics<MapScreen,ClientsideMap[][]>- Returns:
- A copy of this buffer
-
getWidth
public int getWidth()Description copied from class:MapGraphicsGet the width in pixels of this buffer- Specified by:
getWidthin classMapGraphics<MapScreen,ClientsideMap[][]>- Returns:
- The width
-
getHeight
public int getHeight()Description copied from class:MapGraphicsGet the height in pixels of this buffer- Specified by:
getHeightin classMapGraphics<MapScreen,ClientsideMap[][]>- Returns:
- The height
-