Permalink
Browse files

Flambe compatibility tweaks.

  • Loading branch information...
1 parent 899882a commit 571a6312df4d6acd48fb8ec2ff502ffdbff602b6 @aduros committed Nov 24, 2012
Showing with 10 additions and 10 deletions.
  1. +6 −6 src/novella/MainScene.hx
  2. +4 −4 src/novella/StoryReader.hx
View
@@ -18,17 +18,17 @@ class MainScene
var scene = new Entity();
var background = new Entity()
- .add(new ImageSprite(ctx.pack.loadTexture("title.jpg")));
+ .add(new ImageSprite(ctx.pack.getTexture("title")));
scene.addChild(background);
var planet = new Entity()
- .add(new ImageSprite(ctx.pack.loadTexture("planet.png")).centerAnchor())
+ .add(new ImageSprite(ctx.pack.getTexture("planet")).centerAnchor())
.add(new PlanetMotion());
planet.get(PlanetMotion).onUpdate(5000); // Start a few seconds in
scene.addChild(planet);
var logo = new Entity()
- .add(new ImageSprite(ctx.pack.loadTexture("logo.png"))
+ .add(new ImageSprite(ctx.pack.getTexture("logo"))
.centerAnchor().setXY(NovellaConsts.WIDTH/2, 150));
var sprite = logo.get(Sprite);
sprite.scaleX.animate(0, 1, 0.8, Ease.backOut);
@@ -37,11 +37,11 @@ class MainScene
var unlockedEndings = Math.min(ctx.endings.length, 4);
scene.addChild(new Entity()
- .add(new ImageSprite(ctx.pack.loadTexture("endings" + unlockedEndings + ".png"))
+ .add(new ImageSprite(ctx.pack.getTexture("endings" + unlockedEndings))
.setXY(23, 434)));
var startButton = new Entity()
- .add(new ImageSprite(ctx.pack.loadTexture("start.png"))
+ .add(new ImageSprite(ctx.pack.getTexture("start"))
.setXY(209, 286));
startButton.get(Sprite).pointerDown.connect(function (_) {
Metrics.trackEvent("Gameplay", "Start");
@@ -50,7 +50,7 @@ class MainScene
scene.addChild(startButton);
var gamesButton = new Entity()
- .add(new ImageSprite(ctx.pack.loadTexture("games.png"))
+ .add(new ImageSprite(ctx.pack.getTexture("games"))
.setXY(243, 380));
gamesButton.get(Sprite).pointerDown.connect(function (_) {
Metrics.trackEvent("Gameplay", "More Games");
@@ -136,7 +136,7 @@ class StoryReader extends Component
case Speech(text):
var box = new Entity()
- .add(new ImageSprite(_ctx.pack.loadTexture("wordbox.png")));
+ .add(new ImageSprite(_ctx.pack.getTexture("wordbox")));
var sprite = box.get(Sprite);
sprite.y._ = NovellaConsts.HEIGHT - sprite.getNaturalHeight();
_modeLayer.addChild(box);
@@ -228,14 +228,14 @@ class StoryReader extends Component
return new Sprite();
default:
var name = Type.enumConstructor(actor);
- return new ImageSprite(_ctx.pack.loadTexture("actors/" + name + ".png"));
+ return new ImageSprite(_ctx.pack.getTexture("actors/" + name));
}
}
private function createBackdrop (backdrop :Backdrop) :Sprite
{
var name = Type.enumConstructor(backdrop);
- return new ImageSprite(_ctx.pack.loadTexture("backdrops/" + name + ".jpg"));
+ return new ImageSprite(_ctx.pack.getTexture("backdrops/" + name));
}
private function createMusic (music :Music) :Sound
@@ -246,7 +246,7 @@ class StoryReader extends Component
// return null;
// default:
// var name = Type.enumConstructor(music);
- // return _ctx.pack.loadSound("music/" + name);
+ // return _ctx.pack.getSound("music/" + name);
// }
}

0 comments on commit 571a631

Please sign in to comment.