Remove frame-margin #2
This commit is contained in:
@@ -22,9 +22,6 @@ Followed by a collection of definition lines, which always have a leading single
|
||||
- Where `x` and `y` are unsigned integers.
|
||||
- How much the frame needs to be translated every new frame.
|
||||
- Usually identical to your frame-size, but useful for example for skipping every other frame.
|
||||
- `frame-margin x y`
|
||||
- Where `x` and `y` are unsigned integers.
|
||||
- Represents the "empty space" between frames. A lot of spritesheets come with empty space between each sprite frame. This is to prevent frames bleeding into each other.
|
||||
- `frame-count n`
|
||||
- Where `n` is an unsigned integer.
|
||||
- `frame-time n`
|
||||
@@ -38,7 +35,7 @@ Followed by a collection of definition lines, which always have a leading single
|
||||
|
||||
The actual source code tells you most likely all you need to know:
|
||||
```cpp
|
||||
unsigned const x = frameOrigin.x + (frameNumber * frameMargin.x) + (frameNumber * frameStep.x);
|
||||
unsigned const y = frameOrigin.y + (frameNumber * frameMargin.y) + (frameNumber * frameStep.y);
|
||||
unsigned const x = frameOrigin.x + (frameNumber * frameStep.x);
|
||||
unsigned const y = frameOrigin.y + (frameNumber * frameStep.y);
|
||||
```
|
||||
Where x and y are the topleft coordinates of the sprite frame.
|
||||
Reference in New Issue
Block a user