scar
  • The scar game library
  • Application Structure
    • App
    • Scenes
    • Spaces
    • Entities
    • Components
    • Systems
    • Objects
    • Drawing
    • Events
  • Builtin Features
    • Actions
    • Assets
    • Config
    • Input
    • Logger
    • Music
    • Tweens
    • Util
    • Vectors & Rects
  • Builtin Components
    • Text
    • Sprite
    • Animated Sprite
  • Builtin Systems
    • Animate Sprites
Powered by GitBook
On this page

Was this helpful?

  1. Builtin Features

Util

The Scar::Util module provides some useful methods.

File Handling

These methods are supposed to help writing files to a local user directory.

Before using any of them, set the subdirectory inside the user directory (windows: %appdata%\<subdir> | linux: ~/.local/share/<dir>) by calling Scar::Util.dir = <dir>.

After that, you can write and read files with the following methods:

  • write_file(name : String, content : String)

  • write_file_bytes(name : String, content : Bytes)

  • read_file(name) => String

  • read_file_bytes(name) => Bytes

PreviousTweensNextVectors & Rects

Last updated 6 years ago

Was this helpful?