Skip to content

Commit d2acf95

Browse files
committed
swap internal helper with kadabra utils dependency
1 parent 8e61bcf commit d2acf95

File tree

5 files changed

+7
-24
lines changed

5 files changed

+7
-24
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ There is a sample with openfl that can help use this library in any engine.
1515

1616
The sample can be tested here (better fullscreen): http://loudoweb.fr/app/parallax/
1717
And here is the [xml](https://github.com/loudoweb/parallax/blob/master/assets/data/parallax.xml)
18+
19+
# dependency
20+
21+
https://github.com/loudoweb/kadabra-utils

parallax/Parallax.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package parallax;
22
import haxe.ds.WeakMap;
33
import haxe.xml.Access;
44
using parallax.ParallaxHelper;
5+
using kadabra.utils.XMLUtils;
56

67
/**
78
* ...

parallax/ParallaxHelper.hx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,6 @@ import haxe.xml.Access;
77
*/
88
class ParallaxHelper
99
{
10-
11-
/**
12-
* Find xml attribute or use default value
13-
* @param xml
14-
* @param name
15-
* @param defaultValue
16-
* @return
17-
*/
18-
inline public static function getFloat(xml:Access, name:String, defaultValue:Float = 0.0):Float
19-
{
20-
return xml.has.resolve(name) ? Std.parseFloat(xml.att.resolve(name)) : defaultValue;
21-
}
22-
23-
inline public static function getInt(xml:Access, name:String, defaultValue:Int = 0):Int
24-
{
25-
return xml.has.resolve(name) ? Std.parseInt(xml.att.resolve(name)) : defaultValue;
26-
}
27-
28-
inline public static function getBool(xml:Access, name:String, defaultValue:Bool = true):Bool
29-
{
30-
return xml.has.resolve(name) ? xml.att.resolve(name) == "true" : defaultValue;
31-
}
3210

3311
inline public static function sign(n:Float):Int
3412
{

parallax/ParallaxLayer.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package parallax;
22
import haxe.xml.Access;
3-
using parallax.ParallaxHelper;
3+
using kadabra.utils.XMLUtils;
44

55
/**
66
* ...

parallax/ParallaxSprite.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package parallax;
22
import haxe.xml.Access;
3-
using parallax.ParallaxHelper;
3+
using kadabra.utils.XMLUtils;
44

55
/**
66
* ...

0 commit comments

Comments
 (0)