package Image import NoWurst import public Colors import Vectors import ErrorHandling public enum Layer L1 L3 L2 L4 /** Create an image at the target location, the Image has to be a blp, with transparent borders */ public function createImage(string path, vec2 pos, real sizeX, real sizeY) returns image return CreateImage(path, sizeX, sizeY, 0, pos.x, pos.y, 0, sizeX / 2, sizeY / 2, 0, 1) /** Create an image at the target location, the Image has to be a blp, with transparent borders. The layer specifies which image overlaps another: Level 1 is always on the top, and level 4 always in the background. Use the enums "Layer.LX" */ public function createImage(string path, vec2 pos, real sizeX, real sizeY, Layer layer) returns image return CreateImage(path, sizeX, sizeY, 0, pos.x, pos.y, 0, sizeX / 2, sizeY / 2, 0, layer castTo int + 1) /** Shows the image */ public function image.show() SetImageRenderAlways(this, true) /** Hides the image */ public function image.hide() SetImageRenderAlways(this, false) /** Shows the image for a specific player */ public function image.showForPlayer(player p) if GetLocalPlayer() == p SetImageRenderAlways(this, true) /** Hides the image for a specific player */ public function image.hideForPlayer(player p) if GetLocalPlayer() == p SetImageRenderAlways(this, true) /** Set the image 2D position */ public function image.setPos(vec2 pos) SetImagePosition(this, pos.x, pos.y, 0) /** Set the image 3D position */ public function image.setPos(vec3 pos) SetImagePosition(this, pos.x, pos.y, 0) SetImageConstantHeight(this, true, pos.z) /** Set the image height */ public function image.setHeight(real z) SetImageConstantHeight(this, true, z) /** Set the image color by using the colorA tuple */ public function image.setColor(colorA col) SetImageColor(this, col.red, col.green, col.blue, col.alpha) /** Set the image color by using the color tuple */ public function image.setColor(color col) SetImageColor(this, col.red, col.green, col.blue, 255) /** Set the image layer (use the constants) */ public function image.setLevel(Layer layer) SetImageType(this, layer castTo int + 1) /** Destroy the image */ public function image.remove() if this != null DestroyImage(this) else error("Nullpointer exeption by destroying an image")