spritexp 0.2.0 copy "spritexp: ^0.2.0" to clipboard
spritexp: ^0.2.0 copied to clipboard

Kinda like a regular expression language, but for Sprites.

SpritExp #

style: very good analysis Powered by Mason License: MIT

Kinda like a regular expression language, but for Sprites

Installation 💻 #

❗ In order to start using SpritExp you must have the Flutter SDK installed on your machine.

Add spritexp to your pubspec.yaml:

dependencies:
  spritexp:

Install it:

flutter packages get

Using it #

SpritExp basic syntax structure is the following:

{SPRITE COORDINATES AND SIZE}[ * MULTIPLIERS]

Breaking it down, coordinates and size of the sprite are informed by numbers separated by commas, and a couple of formats are accepted:

// {Size} - position defaults to 0,0
{16}
// {X and Y, Width and Height}
{16, 32}
// {X, Y, Width, Height}
{0, 16, 32, 32}

Multipliers are meant to create a sequential list of sprites, based in a a sprite definition explained above.

So, to generate a horizontal list of 2 sprites, the following example can be used:

{0, 16} * 2x

The above will generate two sprites, the first starting at X0 Y0, with a square dimension of 16, and the second at X16 Y0, also with the same dimension.

On the other hand, the following:

{0, 16} * 2y

Will generate two sprites, the first starting at X0 Y0, with a square dimension of 16, and the second at X0 Y16, also with the same dimension.

You can also get a grid of sprites by adding both x and y to the expression:

{0, 16} * 2xy

By default, SpritExp assumes that multipliers are horizontal, so the x can be omitted, meaning that {0, 16} * 2 and {0, 16} * 2x are the same expression.


2
likes
160
points
36
downloads

Publisher

unverified uploader

Weekly Downloads

Kinda like a regular expression language, but for Sprites.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flame, flutter

More

Packages that depend on spritexp