Skip to content

Commit

Permalink
ADD getBE
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Jan 29, 2025
1 parent dfbac6e commit 4ecc0cc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dn/heaps/assets/Aseprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ class AsepriteDictEntry {
return lib.hbe_get(sb, id, frame, xr,yr);
}

/** Allocate a standard BatchElement **/
public inline function getBE(?sb:h2d.SpriteBatch, frame=0, xr=0., yr=0.) : h2d.SpriteBatch.BatchElement {
var be = new h2d.SpriteBatch.BatchElement( getTile(frame,xr,yr) );
if( sb!=null )
sb.add(be);
return be;
}

/** Allocate a HSpriteBE **/
public inline function getRandomHSpriteBE(sb:dn.heaps.slib.HSpriteBatch, ?rndFunc:Int->Int) : dn.heaps.slib.HSpriteBE {
return lib.hbe_getRandom(sb, id, rndFunc);
Expand Down

0 comments on commit 4ecc0cc

Please sign in to comment.