package Image import NoWurst import Vectors import ErrorHandling import public Colors 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 image temp = CreateImage(path, sizeX, sizeY, 0, pos.x, pos.y, 0, 0, 0, 0, 1) //SetImageConstantHeight(temp, true, -2.8) return temp /** 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 image temp = CreateImage(path, sizeX, sizeY, 0, pos.x, pos.y, 0, 32, 32, 0, layer castTo int + 1) //SetImageConstantHeight(temp, true, -2.8) return temp /** 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.show(player p) if GetLocalPlayer() == p SetImageRenderAlways(this, true) /** Hides the image for a specific player */ public function image.hide(player p) if GetLocalPlayer() == p SetImageRenderAlways(this, false) /** 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") endpackage