Skip to content

Lua Script API: Object Functions

Meme1079 edited this page Aug 5, 2022 · 27 revisions

Graphics Functions

makeGraphic(tag:String, width:Int, height:Int, color:String)

Spawns a graphic with no image

  • tag - the sprite object's tag
  • width - the width of the sprite object
  • height - the height of the sprite object
  • color - the color of the sprite object, must be a hex color!

Example: Use makeGraphic('testBlackSquare', 1000, 1000, '000000') to make the Lua Sprite with the tag "testBlackSquare" turn into a 1000x1000 black square.

setBlendMode(obj:String, blend:String)

Changes the blend mode of a Sprite (Works similar to how Photoshop do it)

  • obj - the sprite object's tag
  • blend - Blend mode to use. Example: add, darken, normal. List of blend modes

setGraphicSize(obj:String, x:Int, y:Int = 0, updateHitbox:Bool = true)

Changes the size of the graphic

  • obj - the sprite object's tag
  • x - the x-coordinate of the sprite object
  • y - the x-coordinate of the sprite object
  • updateHitbox - if true will change the sprite's scale manually or via a tween.

Clone this wiki locally