Custom Sprites & Text Functions - VsFoxaTeam/FNF-Unfulfilled-Journey-Foxa-Engine GitHub Wiki

Creating/Adding/Removing Sprite

makeLuaSprite(tag:String, image:String, x:Float, y:Float)

Creates a lua sprite object. (Must Be a .PNG Format)

And you want a color screen put nil on the image parameter and add makeGraphic(). If another lua sprite that exists is already using the tag, it will be removed.

  • tag - The sprite tag or object variable name.
  • image - The image path for the sprite object. (Relative to mods/images, assets/images, or assets/shared/images)
  • x - The x value of the sprite object.
  • y - The y value of the sprite object.

makeAnimatedLuaSprite(tag:String, image:String, x:Float, y:Float)

Creates a lua sprite that supports animations, and must have a xml file with it.

  • tag - The sprite tag or object variable name.
  • image - The image path for the sprite object. (Relative to mods/images, assets/images, or assets/shared/images)
  • x - The x value of the sprite object.
  • y - The y value of the sprite object.

addLuaSprite(tag:String, front:Bool)

Adds a sprite object to the game.

  • tag - The sprite tag or object variable name.
  • front - Whether or not the sprite object gets added on top of the characters.

removeLuaSprite(tag:String, destroy:Bool)

Removes a sprite object from the game.

  • tag - The sprite tag or object variable name.
  • destroy - Whether or not the sprite object should be fully removed, disallowing further use.

Creating/Adding/Removing Text

makeLuaText(tag:String, text:String, width:Int, x:Float, y:Float)

Creates a text object with position x, y, and width. (Must Be a .TTF Format)

  • tag - The text tag or object variable name.
  • text - The text string will have.
  • width - The width of the text; setting it to 0 will automatically determine the width for you.
  • x - The x value of the object.
  • y - The y value of the object.

addLuaText(tag:String)

Adds a text object to the game.

  • tag - The text tag or object variable name.

removeLuaText(tag:String, destroy:Bool)

Removes a text object off the game.

  • tag - The text tag or object variable name.
  • destroy - Whether or not the object will be fully destroyed, making it unable to be re-added.

Setting Text Properties

setTextString(tag:String, text:String)

Sets the text string with a new string value.

  • tag - The text tag or object variable name.
  • text - The new text string value of the text.

setTextSize(tag:String, size:Int)

Sets the text size with a new size value.

  • size - The new text size value of the text.

setTextWidth(tag:String, width:Float)

Sets the text width with a new width value.

  • width - The new text width value of the text.

setTextBorder(tag:String, size:Int, color:String)

Sets the text border with a new border value.

  • size - The new text size value of the border.
  • color - The text color value of the border. (Must be a Hexadecimal Color Code)

setTextColor(tag:String, color:String)

Sets the text color with a new color value.

  • color - The new text color value of the text. (Must be a Hexadecimal Color Code)

setTextAlignment(tag:String, alignment:String = 'left')

Sets the text alignment with a new alignment value.

  • alignment - The new text alignment value of the text's, it can be left, center, right.

setTextFont(tag:String, font:String)

Sets the text font with a new font value.

  • font - The new text font value.

setTextItalic(tag:String, italic:Bool)

Sets the text to italic.

  • italic - Change the text to italic with a Boolean.

Getting Text Properties

getTextString(tag:String)

Gets the current text string.

getTextSize(tag:String)

Gets the current text size.

getTextWidth(tag:String)

Gets the current text width.

getTextBorder(tag:String)

Gets the current text border.

getTextColor(tag:String)

Gets the current text color.

getTextFont(tag:String, font:String)

Gets the current text font.

⚠️ **GitHub.com Fallback** ⚠️