Skip to content

Commit

Permalink
ADD more random getters
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Dec 30, 2024
1 parent 92c41ea commit 90b88c8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dn/heaps/assets/Aseprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ class AsepriteDictEntry {
return lib.h_get(id, frame, xr,yr, p);
}

/** Allocate a HSprite **/
public inline function getRandomHsprite(?rndFunc:Int->Int, ?p:h2d.Object) : dn.heaps.slib.HSprite {
return lib.h_getRandom(id, rndFunc, p);
}

/** Allocate a HSpriteBE **/
public inline function getHspriteBE(sb:dn.heaps.slib.HSpriteBatch, frame=0, xr=0., yr=0.) : dn.heaps.slib.HSpriteBE {
return lib.hbe_get(sb, id, frame, xr,yr);
Expand All @@ -321,5 +326,10 @@ class AsepriteDictEntry {
public inline function getBitmap(frame=0, xr=0., yr=0., ?p:h2d.Object) : h2d.Bitmap {
return new h2d.Bitmap( getTile(frame,xr,yr), p );
}

/** Allocate a Bitmap **/
public inline function getRandomBitmap(xr=0., yr=0., ?rndFunc:Int->Int, ?p:h2d.Object) : h2d.Bitmap {
return new h2d.Bitmap( getRandomTile(xr,yr, rndFunc), p );
}
}
#end

0 comments on commit 90b88c8

Please sign in to comment.