Search the Community

Showing results for tags 'width'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 16 results

  1. I've been checking this documentation, but didn't find anything I can use. Please, help.
  2. OlegShaygu


    Hi! I'm a newborn at Pixi.JS and ask your help. I'm trying to put 4 characters on the stage in one line. They are moving one by one (in ticker function). Stage width is 928px. The gap between characters is 800px. And I can't understand why first three characters are put at the stage right way, but the last one is above the third one. It seems like the the width is not enough. What should I do?
  3. AdamRyanGameDev

    How to set sprite height/width

    I am having some basic syntax confusion... i have declared a sprite... var taxi = this.add.sprite(100, 100, 'taxi').setOrigin(0, 0); and now would like to resize it I have tried various combos (including ideas from phaser2 i found), what am I doing wrong? taxi.width = 25; taxi.setWidth = 25; taxi.setSize = (25,25); Any help for noob here?
  4. I am using this code to create my text field on screen: screenTypingTextField = gameObject.add.text(200, 520, "", si.Utility.getTextStyleScreenTypingTextGreen()); screenTypingTextField.alpha = 0.5; screenTypingTextField.anchor.setTo(0.5, 0.5); //screenTypingTextField.width = 480; //screenTypingTextField.height = 240; thisObject.menuObjects.add(screenTypingTextField); textStyleScreenTypingTextGreen = { font :'70pt Arial', align : 'center', fill: 'Green' }, As you can see I have commented the width and height rows. Its because when i run this code again by entering the same scene that uses this code, it then starts to spread the text over all screen, even bigger. Is this the right way to create text and then set its width and height? Or I should just use the font to set text field size? here is a picture of my typing text field in green spread all over the screen
  5. I am currently learning Phaser by doing some examples. I am currently here: I am wondering, how can I set the height and width of `Phaser.Creature` object? The default `height` and `width` are set to undefined. Hence I need to set both height and width in order to set the `Phaser.Creature` dimension. Here are some codes.; // `true` is used for looping forever. dragon_character.scale.set(20); dragon_character.height = 100; dragon_character.width = 100; console.log(dragon_character.height); // 100. console.log(dragon_character.width); // 100. Here are another codes.; // `true` is used for looping forever. dragon_character.scale.set(20); dragon_character.height = 100; console.log(dragon_character.height); // 100. console.log(dragon_character.width); // Undefined. // Additionally the animation does not show up in the screen. If I only set either height or width, the `Phaser.Creature` will not show up in the screen. I don't know if there is no way to set height and let the width adjusted proportionally (vice-versa). Additionally, I could not found a way to get the height and width properties if the dimension is set with `Phaser.Creature.scale.set(25)`. To sum up, my questions: Is there any way to set either height or width and let the un-set properties to adjust in proportion? How can I know the `Phaser.Creature` height and width if it is set with `Phaser.Creature.scale.set()`?
  6. PixelPush


    Hi All, How should I go about obtaining the size of mesh in pixels? Is this even possible ? I assume there is away to obtain measurements for the bounding box or something..? Cheers
  7. JAA

    Runtime Dimension Changes

    You set up an application element: g_Pixi = new PIXI.Application(width, height, { backgroundColor: 0x000000 }); document.getElementById(strCanvasDiv).appendChild(g_Pixi.view); 'width' and 'height' are the dimensions of the canvas with id strCanvasDiv.. Question 1: in the object, should I send the canvas in the 'view' element? Ie, g_Pixi = new PIXI.Application(width, height, { view: document.getElementById(strCanvasDiv), backgroundColor: 0x000000 }); But then the user decides he wants to change the dimensions of the screen (which in my code will change the dimensions of the canvas). For example, he could modify the window or even change landscape to portrait. Question 2: What do I do to change the dimensions of the renderer to the new dimensions of the canvas so it all works still?
  8. mattbrand

    Maximum image dimensions on mobile

    Is there a maximum image width or height for images imported with game.load.image on mobile? I have a sprite sheet that is 3080 pixels wide, and I think it may be the culprit of an error that is happening.
  9. Laumark

    Updating rectangle width

    It might just be me, being a bit slow tonight, but I'm having trouble updating the width of a rectangle. I was thinking it's something like someRect.width += someValue, but that doesn't seem to work. Can somebody help me out here?
  10. If I do this: function paddleUpdate() { if(isPaddleNerfed) { paddle.frameName = "paddle_small.png"; //48px width } else { paddle.frameName = "paddle_big.png"; //32px width } //Do I have to set the size manually like this paddle.body.setSize(paddle._cache.width, paddle._cache.height); } I ask because with: game.debug.renderSpriteBounds(paddle); I see the pink border and it's changing size (but only visually): collisions and also sprite.body.width still returns the old bigger size rather than the smaller/nerfed one... Also visually it's all ok... and also sprite._cache.width returns correct values. Is my aproach right or is there a better, shorter way ... i clearly understand that it can't and shouldn't be automatic because changing sprite/frames should change the collision body region... but maybe it can be added as option ... or maybe shouldn't I'll be glad to here more opinions about this. EDIT: I just saw that there is: game.debug.renderSpriteBody(paddle); so the only question that leave is this the proper way of doing it since the sprite.body isn't updating on sprite size/frame change
  11. coter

    Displayobject width height

    It's just a nightmare Why DisplayObject has no width and height properties?
  12. In a flash the size of the workspace is stored in Stage. And how to find them pixi.js? Does this ideology framework?
  13. Stephen Persson

    Where's my sprite, Phaser?

    I'd like to get the visual x/y/width/height of a sprite after scaling/skewing/rotating/anchoring it. Can I do that with Phaser? The case: If you flip horizontally a sprite that has {x: 100, y: 100, width: 64, height: 64}, what will your eyes see on the screen? {x: 36, y: 100, width: 64, height: 64}. That's what I'm looking for. However, Phaser tells you:{x: 100, y: 100, width: -64, height: 64}. No big deal, you just do a little math to fix it, kinda like you showed there. That is, if you only scale it. It gets more mathematical when you also change the anchor, and turns into a geometric nightmare if you rotate it too. Phaser is heavily based on Flixel, right? Then my hopes are that you could do it like in Flash, where you can solve all of this by wrapping your sprite into a movieclip and getting the container's x/y/width/height.
  14. I currently want to build a game for iPhone (I have a 5s) using Phaser and CocoonJS. I'm just wondering what the best/most optimized initial game size would be for this! aka for this code: var game = new Phaser.Game(800, 600, Phaser.AUTO, 'icicle-man');What would be the best options to replace 800 & 600 with? -Thanks
  15. Rudis


    Hi there, I'm wondering, if it is valid/possible to set game width/height after game object initialization? What I'm trying to do is set actual game size in boot state when things such device is available. Unfortunately, it takes no effect on canvas, still the same dimension as once set at game object initialization phase. Any suggestion? Thanks!
  16. Is there any difference between Game.width(height) with World.width? Also, is they related to TilemapLayer.renderWidth?