Skip to content

Commit 469dfe2

Browse files
committed
fixed scaling issue
1 parent 019517c commit 469dfe2

File tree

3 files changed

+47
-10
lines changed

3 files changed

+47
-10
lines changed

.github/workflows/main.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
build-windows:
9+
runs-on: windows-latest
10+
name: build windows
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@main
14+
- name: Setup Haxe
15+
uses: krdlab/setup-haxe@master
16+
- name: Install format
17+
run: haxelib install format
18+
- name: Build binary
19+
run: haxe ./build.hxml
20+
- name: Upload Artifact
21+
uses: actions/upload-artifact@main
22+
with:
23+
name: AtlasConverter.exe
24+
path: bin/cpp/Main.exe
25+
if-no-files-found: error
26+
build-linux:
27+
runs-on: ubuntu-latest
28+
name: build linux
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@main
32+
- name: Setup Haxe
33+
uses: krdlab/setup-haxe@master
34+
- name: Install format
35+
run: haxelib install format
36+
- name: Build binary
37+
run: haxe ./build.hxml
38+
- name: Upload Artifact
39+
uses: actions/upload-artifact@main
40+
with:
41+
name: AtlasConverter
42+
path: bin/cpp/Main
43+
if-no-files-found: error

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Haxe project
1+
# Sparrow to Atlas converter
22

3-
This is an example Haxe project scaffolded by Visual Studio Code.
4-
5-
Without further changes the structure is following:
6-
7-
* `src/Main.hx`: Entry point Haxe source file
8-
* `build.hxml`: Haxe command line file used to build the project
9-
* `README.md`: This file
3+
https://gamebanana.com/tools/18801

src/formats/AtlasAnimFile.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class AtlasAnimFile{
4848
// var frameDiff_x = Std.parseFloat(item.frameWidth)-Std.parseFloat(item.width);
4949
// var frameDiff_y = Std.parseFloat(item.frameHeight)-Std.parseFloat(item.height);
5050

51-
var frameX = anim.matrix.offsetX - Std.parseFloat(item.frameX);
52-
var frameY = anim.matrix.offsetY - Std.parseFloat(item.frameY);
51+
var frameX = anim.matrix.offsetX - (Std.parseFloat(item.frameX)*anim.matrix.scaleX);
52+
var frameY = anim.matrix.offsetY - (Std.parseFloat(item.frameY)*anim.matrix.scaleY);
5353
final_matrix = new Matrix(frameX,frameY,anim.matrix.scaleX,anim.matrix.scaleY);
5454
}
5555
frames.push(new Frame(item.name,curFrame,1,final_matrix));

0 commit comments

Comments
 (0)