Jump to content


  • Content Count

  • Joined

  • Last visited

About TickleMeElmo

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Location

Contact Methods

  • Skype

Recent Profile Visitors

1339 profile views
  1. Now that I think of it you probably are looking for something like this instead: //a bit weird name but idk, my creativity is failing me today for some reason. //so the function just keeps the position of first children. function resizeDisplayObjectFirstChildren(obj) { // I've assumed you keep ratio as a global value, probably not a good Idea though. But if you're // just a beginner then who cares right? obj.scale.x = obj.scale.y = ratio; for(var i = 0; i < obj.children.length; i++) { var child = obj.children[i]; if(!child.initPos) child.initPos = {x: child.x,
  2. Well, think of a container as a rubber for a second. and some dots on the rubber as DisplayObjects(Sprites/Containers) in the container, now if you stretch the rubber, not only does it go bigger but the location of dots changes(and the size as well). Same logic appears in PIXI, in all rendering engines I believe. If you only want to change scale and not position then I'm afraid you will have to do it manually by just going over all the elements you want to affect like this and then just changing their scale not position. Ik this is quite hacky approach but couldn't think of any be
  3. Just a blind guess but maybe you mean something like this? If not, please specify a bit const WIDTH = x; const HEIGHT = y; var renderer = PIXI.autoDetectRenderer(WIDTH, HEIGHT, ...); document.body.appendChild(renderer.view); //main container, use this to render everything. var stage = new PIXI.Container(); //the container we want to resize. var container1 = stage.addChild(new PIXI.Container()); //the container we don't want to resize. var container2 = stage.addChild(new PIXI.Container()); var resize = function() { var ratio = Math.min(width / renderer.width, height / renderer.hei
  4. I'm quite sure by look the same you meant fitting it to the screen size while maintaining the aspect ratio. So I think this here should help you: var WIDTH = 350; var HEIGHT = 460; var renderer = PIXI.autoDetectRenderer(WIDTH, HEIGHT, {antialias: false, transparent: false}); document.body.appendChild(renderer.view); var root = new PIXI.Container(); var ratio = Math.min(window.innerWidth / WIDTH, window.innerHeight / HEIGHT); root.scale.x = root.scale.y = ratio; renderer.resize(Math.ceil(WIDTH * ratio), Math.ceil(HEIGHT * ratio)); Let me know if it doesn't. You can also
  5. TickleMeElmo

    Text Input?

    First way would be to try fix this "When using a regular HTML text input, the textbox seems to have focus if I click on it, but typing inside of it does nothing", don't see why pixi would be somehow blocking the input, without the code, can't really say what's wrong either right now. Other way and in my opinion, better way, would be to just build a new text input for pixi. Add event listener for key up event and filter out all unwanted keystrokes, add registered key to stored string and just display that string as PIXI.Text. This way it's also quite easy to later on add some fancy stuff t
  6. well so that you would get the basic idea of how it works, when a new player connects, or joins the game room, the same map or whatever, then that player sends a message to the (the code does it not the player himself ofc) server, server then sends a message to other players online, now all players spawn a new player(a sprite to show where other player is) in their client, when a player moves then he sends a message again to the server, server sends a message to all other players and so on...
  7. hmm, that's interesting, that shouldn't have big effect. Are you sure that you don't use any Phaser scalemanager or something?
  8. seems like you're also scaling the stage, also add scale into there then
  9. top left corner right? just use worldTransform.tx + camera.x, worldTransform.ty + camera.y
  10. I personally think that the controlling of the car should be relative to the car, like when the y is bigger than car.y then the car turns right etc. right now it is if y is bigger than the center. Don't know about others but I find this quite disturbing, other than that it is quite cool game.
  11. well actually yes, specially if the game is like Runescape or LoL styled that you click where you want to move, so in this case just stick with php and it will work totally fine
  12. yeah, I'd use nodejs websockets if I were you. Well yeah I think it would be more simple if you used all javascript(nodejs for backend), but it is possible to do it like php sends some stuff and then the socket will be with nodejs. As I understand you are using phaser so you can just create socket connection in the game state, for how to do it just watch this :
  13. Oh, for fucks sake I'm an idiot, Phaser is built upon pixi, just use .worldTransform.tx, and .worldTransform.ty. just remember to use these after a render loop otherwise they haven't updated
  14. okey, I'm quite confused right now, will continue looking into this tomorrow
  • Create New...