Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Outputting graphics...


Rayj
 Share

Recommended Posts

Nope! Any errors in console? That would likely break your JS and make the loop stop. If you are using XHTML, document.write is invalid.

 

I am not seeing a single thing in Firebug besides the "Got Here" that prints with each loop iteration?

I comment out the document.write and all is well?

 

Weird!

 

Ray

Link to comment
Share on other sites

All I am trying to do here is output playing cards 2,3,4,........10,J,Q,K,A, of Hearts,

For some reason, all I see are two cards, the A of Hearts and the King of Hearts?

 

When I enable the document.write, I see 13 outputs of "Got Here!"  but then no cards!

 

Here is my code:

 

for(i=2; i < 15; i++){
  loader.add("images/cards_gif/h" + i + ".gif");}
  loader.load(setup);

 

var table = new PIXI.Sprite.fromImage("images/table.png");
      
table.x = 300;
table.y = 300;
stage.addChild(table);
//renderer.render(stage);

var card = {};

 

for(i=2; i < 15; i++){
//document.write("got here!");
    card = new PIXI.Sprite.fromImage("images/cards_gif/h" + i + ".gif");
    stage.addChild(card);
    renderer.render(stage);
    card.x = card.x + 72;
    card.y = 0;
           };

Link to comment
Share on other sites

Why are you using document.write and not console.log? Please don't use document.write() if at all possible. As for why it is breaking your app there is no way to know without me running your app in the exact entirety that you are.

 

Ok but that is not an issue on it's own.

 

Ok, I changed it to console.log and now it runs, but I only see one console.log message?

 

The console.log is inside a loop that should have 13 iterations?

Link to comment
Share on other sites

Ok but that is not an issue on it's own.

 

Ok, I changed it to console.log and now it runs, but I only see one console.log message?

 

The console.log is inside a loop that should have 13 iterations?

Wow....why is a simple console.log  acting so weird?  I have a console.log right after entering the loop.  It only triggers once?

GET http://192.168.1.116/ [HTTP/1.1 200 OK 16ms]

"Pixi.js 3.0.6 - WebGL - http://www.pixijs.com/" pixi.min.js:7:27113

"got here in loop!"

 

If I add another console.log a little further down but still inside the loop, I get:

 

GET http://192.168.1.116/ [HTTP/1.1 200 OK 12ms]

"Pixi.js 3.0.6 - WebGL - http://www.pixijs.com/" pixi.min.js:7:27113

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!" 192.168.1.116:56:1

"got here in loop!" 192.168.1.116:52:1

"got here after renderer!"

 

Makes no sense to me!!!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...