Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After Texture has loaded, cannot use width/height properties #355

Closed
kamranayub opened this issue Nov 14, 2014 · 0 comments
Closed

After Texture has loaded, cannot use width/height properties #355

kamranayub opened this issue Nov 14, 2014 · 0 comments
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Milestone

Comments

@kamranayub
Copy link
Member

Reproduce:

/// <reference path="../../../../dist/Excalibur.d.ts"/>

var game = new ex.Engine(800, 503, "game");
var padTexture = new ex.Texture("gamepad.png");

game.start(new ex.Loader([padTexture])).then(start);

function start() {
   // Load gamepad sprite
   // BUG: Can't use padTexture.width/padTexture.height
   var padSprite = new ex.Sprite(padTexture, 0, 0, 800, 503);

   // Enable Gamepad support
   game.input.gamepads.enabled = true;

   // Draw gamepad
   var gamepad = new ex.Actor(0, 0, padSprite.width, padSprite.height);
   gamepad.addDrawing("bg", padSprite);
   game.add(gamepad);
}
@kamranayub kamranayub added the bug This issue describes undesirable, incorrect, or unexpected behavior label Nov 14, 2014
@jedeen jedeen modified the milestone: LD31 Preparation Nov 16, 2014
@jedeen jedeen modified the milestones: LD31 Preparation, 0.3 Release Dec 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Projects
None yet
Development

No branches or pull requests

2 participants