Skip to content

β2.2.1 - Make Made Easy!

Pre-release
Pre-release
Compare
Choose a tag to compare
@BtheDestroyer BtheDestroyer released this 20 Mar 07:40
· 18 commits to master since this release

Icon SpriteTools Beta 2.2.1

NOTE: Forgot to update the splashscreen and don't really have the tools to do so right now. Expect it to be fixed by 2.2's release!

There's some major updates to the Makefile in this version. tl;dr: Install this to get all the dependencies

Make sure you read the ReadME before asking questions. Many of them are answered there.

How to Use

Extract the Source listed below to an empty folder, then run the command make install to install the library and all of its dependencies. You may need sudo privileges to do so on Linux and macOS.

Attached is an example.beta2.2.zip file as an example of how to use the library.

New to SpriteTools and/or programming? Check out the Tutorial on the Wiki. It's designed for beginners so even if you have no experience, you should get by fine. The tutorial for 2.2 will be released with the official release so if you need a tutorial, it's probably best to use an earlier official release rather than a beta.

New Features

Easy-Install Dependencies

The Makefile can now download and install all needed dependencies on its own! That means you only need to worry about downloading Spritetools to get everything you need - no more repository searching.

Entity Following Cameras

  • You can tell a camera to follow an entity with ST_CameraSetFollowEntity(st_camera *cam, st_entity *ent)

  • Clear the camera's followed entity with ST_CameraClearFollowEntity(st_camera *cam)

  • You can set and modify a camera's offset from the entity it's following with ST_CameraMoveFollowOffsetBy(st_camera *cam, double x, double y) and ST_CameraMoveFollowOffsetTo(st_camera *cam, double x, double y) respectively.

  • Use ST_CameraMoveToFollow(st_camera *cam) to set a camera's position, rotation, and scale to match it's settings relative to the entity it's following. Has no effect if the camera is not following an entity.

  • Cameras now have the following "follow-flags":

Flag Description
CFF_ROTATE_WITH_ENTITY Sets the camera's rotation to the followed entity's rotation
CFF_OFFSET_WITH_ROTATION Modifies the camera's offset by rotating it around the entity by thier rotation value
CFF_INVERT_SCALE_WITH_ENTITY Sets the camera's scale to be the inverse of the followed entity's scale
CFF_OFFSET_WITH_SCALE Modifies the camera's offset by scaling it by the thier scale value
CFF_ALL For use when setting or toggling all flags
  • ST_CameraSetFollowFlag(st_camera *cam, CAMERA_FOLLOW_FLAGS flag, bool state) will set a camera's follow-flag to true or false based on the state given.

  • ST_CameraSetToggleFlag(st_camera *cam, CAMERA_FOLLOW_FLAGS flag, bool state) will toggle a camera's flag on and off.

  • You can use ST_CameraCheckFollowFlag(st_camera *cam, CAMERA_FOLLOW_FLAGS flag) to test if a camera's follow-flag is on.

Main Camera

It can sometimes make code shorter if there is a "Main Camera" in use. An example would be rendering from multiple cameras depending on the buttons being pressed. You can make give every option their own render function which may be more difficult to debug or harder to read, or you can use one "main" camera to render with all the time and have a few if statements switch which camera is the "main" one.

  • ST_MainCameraSet(st_camera *cam) will set the Main Camera to the given camera.

  • ST_MainCameraClear() will clear the Main Camera.

  • ST_MainCameraGet() will return the Main Camera.

Added sfillib Support

In response to #4.

If you have sfillib installed (it will be if you install SpriteTools using the provided Makefile), you can now use the following functions as you would in sfillib. They all return a st_spritesheet *.

  • ST_SpritesheetCreateSpritesheetPNG(const void *buffer)

  • ST_SpritesheetCreateSpritesheetBMP(const void *buffer)

  • ST_SpritesheetCreateSpritesheetJPEG(const void *buffer, unsigned long buffer_size)