Skip to content

Commit

Permalink
Merge branch 'orig_size' into blendadd
Browse files Browse the repository at this point in the history
  • Loading branch information
RudolfVonKrugstein committed Dec 2, 2014
2 parents 7e64b5a + 606ef26 commit 8aef5d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions spritesheet/data/SpritesheetFrame.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@ class SpritesheetFrame {
public var width:Int;
public var x:Int;
public var y:Int;
public var origWidth:Int;
public var origHeight:Int;


public function new (x:Int = 0, y:Int = 0, width:Int = 0, height:Int = 0, offsetX:Int = 0, offsetY:Int = 0) {
public function new (x:Int = 0, y:Int = 0, width:Int = 0, height:Int = 0, offsetX:Int = 0, offsetY:Int = 0, origWidth:Int = -1, origHeight:Int = -1) {

this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.offsetX = offsetX;
this.offsetY = offsetY;
this.origWidth = (origWidth == -1)?width:origWidth;
this.origHeight = (origHeight == -1)?height:origHeight;

}


}
}
2 changes: 1 addition & 1 deletion spritesheet/importers/LibGDXImporter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class LibGDXImporter {
for (i in 0...frames.length) {

var gdxFrame = frames[i];
var sFrame = new SpritesheetFrame (gdxFrame.xy.x, gdxFrame.xy.y, gdxFrame.size.w, gdxFrame.size.h, gdxFrame.offset.x, gdxFrame.orig.h - gdxFrame.size.h - gdxFrame.offset.y);
var sFrame = new SpritesheetFrame (gdxFrame.xy.x, gdxFrame.xy.y, gdxFrame.size.w, gdxFrame.size.h, gdxFrame.offset.x, gdxFrame.orig.h - gdxFrame.size.h - gdxFrame.offset.y, gdxFrame.orig.w, gdxFrame.orig.h);
sFrame.name = gdxFrame.filename;

indexes.push (allFrames.length);
Expand Down
2 changes: 1 addition & 1 deletion spritesheet/importers/TexturePackerImporter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TexturePackerImporter {
for (i in 0...frames.length) {

var tpFrame:TPFrame = frames[i];
var sFrame = new SpritesheetFrame ( tpFrame.frame.x, tpFrame.frame.y, tpFrame.frame.w, tpFrame.frame.h );
var sFrame = new SpritesheetFrame ( tpFrame.frame.x, tpFrame.frame.y, tpFrame.frame.w, tpFrame.frame.h, tpFrame.sourceSize.w, tpFrame.sourceSize.h );

if( tpFrame.trimmed )
{
Expand Down

0 comments on commit 8aef5d8

Please sign in to comment.