Search the Community

Showing results for tags 'height'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Found 19 results

  1. 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
  2. I am currently learning Phaser by doing some examples. I am currently here: https://phaser.io/examples/v2/animation/creature-dragon-multiple. 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. dragon_character.play(true); // `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. dragon_character.play(true); // `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()`?
  3. Dimensions

    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
  4. My heightmap

    Hi this is my heightmap where blue area is the lowest and orange color is the heightest. However, babylonJS interprets the orange/red color to the lowest zone like blue area. How can change this? Thanks
  5. 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.
  6. HeightMap+Oimo Physics

    I saw on original, oimo js website, that it supports physics on irregular terrain. The question is: Does oimo js plugin for Babylon js, can do it too?
  7. Displayobject width height

    It's just a nightmare Why DisplayObject has no width and height properties?
  8. In a flash the size of the workspace is stored in Stage. And how to find them pixi.js? Does this ideology framework?
  9. Hello again. So as stated in the topic title i want to know if there is any alternative for getHeightAtCoordinates function. Here is the solution i thought of: I have a ground 3000x3000 loaded with createGroundFromHeightMap. The problem with getHeightAtCoordinates is that it is too slow. For instance if i have a set of 200 points and if i try to find out the y coordinate for each one using a for loop, the y is set to 0. One solution i thought of(knowing that the ground is not going to change) is to remember in an array all the y coordinates of all points (i know there are 9 000 000 y coordinates for the whole map) - or for the active part of the map; the first time i load up the map. My question would be, is there anyway i can compute the y coordinates, without relying on getHeightAtCoordinates? Thank you in advance. Note: I'm only interested in height where coordinates are whole numbers (ex: y where x=1.0 , z=2.0)
  10. 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.
  11. Hi, First of all, I'm just moving to Phaser game engine to develop even more quality games. I've been using my own game engine and I enjoyed it. But to keep up with the dev speed, developing more game engine features to follow up my need uses too much time than developing the game itself. So I am expecting some of the features may run as my expectation. As I am just jumping to this, I wish for lots of things to learn from you guys. -- I am currently developing a game that is expecting the game screen height not adjusting the size of the game world. Please see below picture on what happened when I have a bigger height/resize the height (Below are samples only, please don't calculate the width/height based on the picture). Normal, expected Bigger height, the game UI is cut as they become larger. The game is scaled bigger, following the height. Even bigger height, the game UI is further cut as they become larger. Same case as previous one, the game is scaled even further, following the height. My expectation is like one of the game I made: http://cake-robot.alectora.com/ Try starting it with your desktop browser with landscape size, and then try playing with only the height. It gives example that it doesn't scale the game size (the sprite size stays the same). The game is only resized when you play the width of the window. I used the game.scale SHOW_ALL (and tried other options), playing with aspect ratios, and still I can't make it like the game I mentioned. Any solution to this? Thank you!
  12. Hey, I'm figuring out how to set a pause screen on my vertical platformer game. Everything is working fine, except I don't know how to position the pause screen in the current viewport and not at the complete top of the game. The game itself is 5000px high and the viewport is 600px. I've tried different things, but so far without success. My pause function, which is now positioned at 0, 0 managePause: function () {game.paused = true;var graphics = game.add.graphics(0, 0);graphics.beginFill(000000, 0.5);graphics.drawRect(0, 0, 1200, 600);var vowText = this.add.text(600, 300, vow1, fontStyle);vowText.anchor.setTo(0.5, 0.5);this.input.onDown.add(function() {vowText.destroy();graphics.destroy();game.paused = false;}, this);},
  13. Hi guys, Its posible to get the height of a heightmap given the X and Z coordinates? Here i show an image explaining what i want: Thanks in advance, Carlos R.
  14. Hello forum, I am trying to make a grid of DisplayObjectContainers, so I am sorting elements depending on the width and height of each one. I add a Sprite in a container and the problem is when I add a Graphics element of the same size inside the container, the width and height changes. I narrowed the problem here : var cont = new PIXI.DisplayObjectContainer();stage.addChild(cont);var convx = new PIXI.Sprite.fromImage('assets/img.png');//>>>>>>> image is 289x333cont.addChild(convx);var msk = new PIXI.Graphics();msk.beginFill(0x123456,0.5);msk.drawRect(0,0,convx.width,convx.height/2); //>>>>>>> line above makes cont.width and height 309x343 (???)msk.drawRect(10,0,convx.width-20,convx.height/2-10); //>>>>>>> line above makes cont.width and height = is 289x333 (same as the image)cont.addChild(msk);So why does the width and height changes when I draw a Rectangle of the same size in the same container ? Do you have the same problem ? Thank you
  15. Getting width and height from body

    Hi there, I'm trying to get the width and height from the returned body: var body = this.game.physics.p2.convertCollisionObjects(map, "floorMiddle")[0]; It would be great if this was possible: body.width body.height And, unfortunately the body.sprite=null otherwise I'd just access the sprite info. Thanks, Gar
  16. 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
  17. Phaser.Game#width/height

    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!
  18. I've been checking this documentation, but didn't find anything I can use. Please, help.