Rayj

Members
  • Content Count

    27
  • Joined

  • Last visited

Everything posted by Rayj

  1. I'm fairly new to programming so bear with me. I have a webpage that is access like this: https://xxxx.com:1234 I am using node.js and not apache. What is the best way to change the access to https://xxx.com Next, the page has a drop down menu. It has 3 choices: Super User, Moderator and User. I want to access the page something like this: https://xxxx.com/SuperUser or https://xxxx.com/moderator or https://xxxx.com/user The 3 choices have to password protected also. The code looks something like this: <select> <option>Super User</option> <option>Moderator</option> <option>User</option> </select> <button>Continue</button> ... ... ... var select = document.querySelector('select'); var button = document.querySelector('button'); ... ... button.onclick = function() { var access = select.value; So I have to get rid of the button.onclick for one, but how do I incorporate the same access into a URL? Thanks in advance! Ray
  2. I think using JSON.encode is doing the trick for me. Now have to figure out how to make my code reiterative. The integer will be changing fairly often.
  3. Learning JS will not tell me how to pass data from PHP to Javascript. I've taken multiple Javascript tutorials. Not one mention of PHP.
  4. I have a small PHP script that pulls some data out of a database. There are two parts to the data, a string variable and an integer. (ex: Chevy 22.55) I want to pass these to PIXI Javascript in order to display them like this: Chevy 22.55 Note: No space after Chevy. I don't know why posts are double spaced in this forum? Thanks, Ray
  5. Rayj

    Scrolling Text

    Is there an example anywhere of scrolling text? I want to scroll text from right to left at the bottom of a webpage. Thanks, Ray
  6. Rayj

    Outputting graphics...

    And I made no changes but I am getting this error: The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page. Now what?
  7. Rayj

    Outputting graphics...

    But I am using Firefox?
  8. Rayj

    Outputting graphics...

    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!!!!
  9. Rayj

    Outputting graphics...

    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?
  10. Rayj

    Outputting graphics...

    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; };
  11. Rayj

    Outputting graphics...

    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
  12. Ok I am outputting some graphics using PIXI. Looks fine. However if I add a simple document.write("Got Here!"); I see the Got Here, but the PIXI output disappears? Any idea why? Ray
  13. Rayj

    Javascript Question...

    So I have this code: var card = {}; for(i=1; i < 11; i++){ card = new PIXI.Sprite.fromImage("images/cards_gif/h" + i + ".gif");} //Add the table and cards to the stage table.x = 300; table.y = 300; stage.addChild(table); stage.addChild(card.1); card.2 = 72; card.2 = 0; stage.addChild(card.2); But I'm getting this error: SyntaxError: missing ) after argument list at stage.addChild(card.1); Ideas? Ray
  14. I am using PIXI, but I have a Javascript question. Rather than doing somehing like this: var card1 = new PIXI.Sprite.fromImage("images/cards_gif/h1.gif"); 52 times (for a 52 card deck of cards), how could I simplify this using a loop? (I am only using 10 cards right now, but in total, there would be 52) So right now I have the following: var card1 = new PIXI.Sprite.fromImage("images/cards_gif/h1.gif"); var card2 = new PIXI.Sprite.fromImage("images/cards_gif/h2.gif"); var card3 = new PIXI.Sprite.fromImage("images/cards_gif/h3.gif"); var card4 = new PIXI.Sprite.fromImage("images/cards_gif/h4.gif"); var card5 = new PIXI.Sprite.fromImage("images/cards_gif/h5.gif"); var card6 = new PIXI.Sprite.fromImage("images/cards_gif/h6.gif"); var card7 = new PIXI.Sprite.fromImage("images/cards_gif/h7.gif"); var card8 = new PIXI.Sprite.fromImage("images/cards_gif/h8.gif"); var card9 = new PIXI.Sprite.fromImage("images/cards_gif/h9.gif"); var card10 = new PIXI.Sprite.fromImage("images/cards_gif/h10.gif"); How could I use a loop to reduce the lines of code? Something like: for(i=1; i < 11; i++){ var card + i = new PIXI.Sprite.fromImage("images/cards_gif/h" + i + ".gif");} This obviously doesn't work. I need variables card1 through card10 (through card 51 later). Thanks, Ray
  15. Here is webpage for Pixi.js : http://www.pixijs.com/ You could go here for some great examples: http://pixijs.github.io/examples/index.html?s=basics&f=spritesheet.js&title=SpriteSheet%20Animation
  16. Sorry I have not gotten back to ya'll. Been trying to figure out how to randomize a deck of cards for the last couple weeks! I think I have it. Now I need to figure out how to use Pixi.js for handling the graphics. I appreciate the response and will look into the suggestions. Ray
  17. Rayj

    Array of graphics?

    My attachment would not load. Sorry.
  18. Rayj

    Array of graphics?

    So, I am fairly new at Javascript programmng and totally new to Pixi.js. How do I initilize an array with gif file names or pointers, so later I can call up the graphic to display? What I want to do is create a deck of playing cards and later deal them out. I have the rendomization figured out already. I have the graphic gif files representing each card of the 52 card deck named: h1.gif-h13.gif, c1.gif-c13.gif, d1.gif-d13.gif and s1.gif-s13.gif representing the suits Hearts, Clubs, Diamonds and spades respectively. So card[0] would be Ace of Hearts. card[1] = 2 of hearts,.... card[13] = king of hearts, card[14] = Ace of Diamonds, card[15] = 2 of Diamonds, etc. See attached example. So the main thing I need is to populate the array size of 52 with the corresponding gif file names. Thanks, Ray
  19. Rayj

    Background color...

    Please excuse my simple questions. I am following the tutorial at https://github.com/kittykatattack/learningPixi#installingpixithesimpleway I am able to create the stage and render sprites. I guess the default stage background color is black. However, when I add renderer.backgroundColor = 0x777777; to change it to white, the stage changes to grey? What am I doing wrong? Thanks, Ray Oh dang...never mind. I forgot I'm working in hex. Sorry.
  20. Thanks, but I get a 404 error with your link? Ray
  21. So I am new at Pixi. I tried the demo at http://www.goodboydigital.com/pixi-js-tutorial-getting-started/ It works fine. Now, I noticed that the github download of pixi,js has a file size of over 700k but the pixi.js that the demo is using is 99K in size? So I tried the demo with the github latest pixi.js and it does not work? Any deas why? Thanks, Ray
  22. I am not a programmer. There, got that out of the way! However, I do know enough about various programming languages to just about be dangerous. That said, I am interested in developing a 4 player card game (played over the internet) and can't quite figure out how to keep track of each player and their cards. I know the concept of shuffling and dealing the cards randomly, but can't grasp how to deal around the table to 4 players and track each hand. (the game will be "trick" based.) Another thing bugging me is how to keep the cards private so only the card holder can see his own cards and not the other 3 players. I've read a little about websockets and socket.io and wonder if one of these could come into play in this development? Of course I'd like to be able to enhance this from a one table game to multiple tables. And I will use PIXI,js for the graphics rendering. Unless something better exists? Thanks and look forword to your ideas or suggestions. Ray
  23. Rayj

    Newbie With HTML5

    Wow. Thanks! Off I go to play!
  24. Rayj

    Newbie With HTML5

    Thanks for the info. I did see some of these error in Chrome, but I didn't know this example was not compatible with v3.0.6. Could you point me to an example with source code that is compatible with v3.0.6? Thanks, Ray
  25. Rayj

    Newbie With HTML5

    I am trying an example at: http://modernweb.com/2013/11/04/building-a-parallax-scrolling-game-with-pixi-js/#comment-78088 You can see the demo in action here: http://www.yeahbutisitflash.com/pixi-parallax-scroller/final/index.html The initial stage light grey on black is fine. But from the point where it says the stage turns green and forward, it does not work! I followed the tutorial directly. Here is where I left off. Please let me know where I went wrong. <html> <head> <meta charset="UTF-8"> <title>Parallax Scrolling Demo</title> <meta charset="UTF-8"> <title>Endless Runner Game Demo</title> <style> body { background-color: #000000; } canvas { background-color: #222222; } </style> </head> <body onload="init();"> <div align="center"> <canvas id="game-canvas" width="512" height="384"></canvas> </div> <script src="pixi.js-master/bin/pixi.js"></script> <script> function init() { stage = new PIXI.Stage(0x66FF99); renderer = PIXI.autoDetectRenderer( 512, 384, document.getElementById("game-canvas") ); var farTexture = PIXI.Texture.fromImage("resources/bg-far.png"); far = new PIXI.Sprite(farTexture); far.position.x = 0; far.position.y = 0; ^?stage.addChild(far); var midTexture = PIXI.Texture.fromImage("resources/bg-mid.png"); mid = new PIXI.Sprite(midTexture); mid.position.x = 0; mid.position.y = 128; stage.addChild(mid); requestAnimFrame(update); } function update() { far.position.x -= 0.128; mid.position.x -= 0.64; renderer.render(stage); requestAnimFrame(update); } </script> </body> </html>