SpritePixels

Methods
9
Fields
1

Getting one

ImageUtil.getImageSpritePixels(…)
client:drawInstanceMap(…)
client:createSpritePixels(…)

Methods

MethodReturnsDescription
getWidth()numberThe stored width (the pixels' row length).
getHeight()numberThe stored height.
getMaxWidth()numberThe full frame's width.
getMaxHeight()numberThe full frame's height.
getOffsetX()numberWhere the stored pixels start in the frame, across.
getOffsetY()numberWhere the stored pixels start in the frame, down.
getPixels(){number}The pixels, row by row (a copy; element 1 is pixel 0): a client sprite's 24-bit RGB, 0 transparent and a drawn black 1; a sprite made f…
toBufferedImage()BufferedImageA new getWidth() x getHeight() image of the pixels, every non-zero pixel ORed opaque (a drawn black reads 0xff000001).
toBufferedOutline(Color)BufferedImageA new image of the sprite's outline in color: each pixel that is 0 or 0xffffff beside a non-zero one becomes color, every other pix…

Fields

FieldTypeDescription
DEFAULT_SHADOW_COLORnumberSpritePixels.DEFAULT_SHADOW_COLOR.

Returned by

MethodReturnsDescription
Client.createItemSpriteSpritePixels?Item itemId's inventory sprite as the client draws it (quantity, border, shadowColor, stackable mode, scale), at once on the ga…
Client.createSpritePixelsSpritePixelsA sprite of pixels (width * height ints, row by row, as given: getPixels() answers them back unchanged, alpha included, and 0 draws n…
Client.drawInstanceMapSpritePixelsA picture of plane z (0..3) of the loaded scene, 736 pixels a side (the 184-tile extended scene at 4 pixels a tile, north up), drawn by t…
Client.getCrossSprites{SpritePixels}?The click cross frames (4 yellow, then 4 red), as a live 1-based view of the array the client draws from (one for every plugin): `crosses[i…
Client.getMapDots{SpritePixels}The minimap's dot sprites, a live 1-based view by dot id + 1 (DOT_ITEM 0 is dots[1], then DOT_NPC, DOT_PLAYER, DOT_FRIEND, `DOT_T…
Client.getSpriteOverrides{[number]: SpritePixels}The sprite overrides, sprite id to SpritePixels as a keyed table (the same table every call, shared by every plugin): `t[spriteId] = spri…
Client.getSprites{SpritePixels}?Every frame of sprite group archiveId (a SpriteID), decoded now: the client's SpriteBuffer read, as spriteManager:getSprite reads o…
Client.getWidgetSpriteOverrides{[number]: SpritePixels}The widget sprite overrides, by packed widget id (InterfaceID), the same keyed table form: the widget draws sprite in place of its own…
ImageUtilClass.getImageSpritePixelsSpritePixelsThe image as SpritePixels: its ARGB pixels, every fully transparent one 0. Pass the client global.

Method details

getPixels

getPixels: (SpritePixels) -> {number}

The pixels, row by row (a copy; element 1 is pixel 0): a client sprite's 24-bit RGB, 0 transparent and a drawn black 1; a sprite made from ints (client:createSpritePixels, ImageUtil.getImageSpritePixels) answers them as given. A write to the copy does not change the sprite.

toBufferedOutline

toBufferedOutline: (SpritePixels, Color) -> BufferedImage

A new image of the sprite's outline in color: each pixel that is 0 or 0xffffff beside a non-zero one becomes color, every other pixel transparent (a lone 0xffffff is kept, which is a transparent white).