Search the Community

Showing results for tags 'render'.



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 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 76 results

  1. Damla Eker

    Dynamically created image masks

    Hi all, I need to display a large image and dynamically hide sections of it. I already use masking to specify which parts should be displayed. The code I use to achieve this is in the form: this._topMask = game.add.graphics(0, 0); this._topMask.drawRect(0, 170, game.width, vm.ActiveGameHeight - 320); this.defaultGroup.mask = this._topMask; This is useful in that it gives me a rectangle within which the image renders. Now I need to dynamically block sections of that rectange and create areas that are not rendered. Ideally, I would like to be able to create masks similar to the image below. I cannot use presaved images because the position of the rectangles change dynamically. What is the most performance optimised way to achieve this in Phaser? (I am on version 2.4.4)
  2. Всем привет! Если мы напишем let enabled = this.game.renderer.setTexturePriority(['UIAtlas', 'InGameAtlas']); в первом состоянии текстуры отображаются нормально. При изменении состояния. this.game.state.start('InGame'); текстуры исчезают. https://prnt.sc/jbcdz0 информация об отладке https://prnt.sc/jbcdz0 в чем проблема? Благодаря!
  3. Hello everyone! i have a very specific question, i need to somehow pause the game at the end of the frame render, execute a function and then render the next frame, and do the same over and over, is that possible? if there is no function that would allow to do that, what is the function that takes care of the scene rendering so i could modify it? Thanks!
  4. Francis Needham

    Problems on ANDROID DEVICES

    Hi all, We've published a babylon js based product configurator for a client here : https://v-moda.com/pages/forza-metallo_customizer it works perfectly everywhere but on my brand new galaxy S9 the scene renders like this : what could be the cause of it ? any ideas ? Thanks ! PastedGraphic-2.tiff
  5. jollibee

    Pause render in pixijs

    The webivew which use pixijs will crash on iOS when the app goes background, something like: _gpus_ReturnNotPermittedKillClient. So, we have to pause the webgl render. There is lockRender in Phaser. Is there a similar method in Pixijs to pause renderer? Thank you. updateRender: function (elapsedTime) { if (this.lockRender) { return; } // ... }
  6. Hi everyone, I've just signed up to this forum and I want to show you my new game made in Consturct 2. This game is not 100% finished ( maybe 95%) so there's a few bugs.Also ignore the "audiojungle" sounds.I haven't bought the sounds yet. Any comments and questions are welcome. Play the preview here : http://www.actionoyun.0fees.us
  7. askerpro

    extract image array from video

    I have an mp4 video file (H264 encoded). I want to create a PIXI.extras.AnimatedSprite from this video to be able not lagging reversed animation play; If I splice this video to image sequence the size becoming huge (about 8Mb vs 500kb of mp4). I want to load low size mp4 file and extract image array from it to create an Animated Sprite. Reverse playing directly from <video> by changing video.currentTime is lagging. I want to create something like hover/unhover animation.
  8. Hello, is there a way to advance a VideoTexture by just 1 frame per RenderLoop? As I understand it now it is time based. This creates the problem that if the frames need to be captured to create an animated sequence, the video keeps advancing in between 2 captured frames.
  9. MouseCaneta

    Show fps on screen

    Is there a simple way to show fps in PIXI.js?
  10. Hi everyone I read this about gltf : https://pissang.github.io/qtek-model-viewer/ and test it with "Adam head " : https://sketchfab.com/features/gltf The render system is the same than Sketchfab for post processes. It's really cool because when there is no animations, the engine calculate step by step a better render quality. Post processes like ambiant occlusion look really great and not drop fps. This allow us to run scene with 60fps with animation and to return a beautiful image when all meshes are fixe. All post processes and shadows seem to be calculate with a rough noise at the beginning and with more precision at the end. ( It's look like a trick to get more performance ...) So, I open this post to discuss about that and to see if it will be a great idea to add it in Babylon What do you think ? Have a nice day ! PS : I ask this because I'm working on this :
  11. Vizcur

    Center text in container

    Hi, My query is this: I use the Cocos creator tool to position a text. When you export the position of this element and then integrate it into my phaser game, it happens that the selected position is slightly different from what is previewed in the Cocos tool. I suspect it is due to how both tools draw the font in their respective container. As you can see in the attached images, in the tool the text is centered in its container, however, in Phaser, when debugging the edges of the text, you can see that the font is positioned upwards. In short, both containers are in the same position but the texts are drawn in different positions. Is there any way to modify how Phaser draws the text in his container? As additional information, both texts are centered and added to a sprite as a child. The way the text is positioned varies according to the font used. Cocos tool Phaser:
  12. Barthandelus

    [PHASER] Rendering player (CANVAS)

    Hi, I'm a actually making a game using PHASER. On this game, player have to jump to escape balls rolling on the ground, like on an infinite runner. Actually, everything is working fine but the player is showed using a spritesheet divided on 128*128 resolution. The character animation running doesn't use 128 pixels on width causing the ball to collide with the player even if the player doesn't hit the ball. The player hitbox is actually configured to 128*128 but I know that in previous versions of PHASER, it was possible to render player to make his hitbox scale his skin. I didn't find this function in the actual version of PHASER. Can someone help ? Thanx in advance. For information : Phaser example on previous versions :
  13. Gerente

    Rendering Only "In Screen" objects

    Hello, I'm doing some stress test with PIXI, and it seems that PIXI draw all the element of the stage, it does not matter if they are in range off the screen or not. I'm trying with 300 circles and even if I move the layer to coordinates very far from the "screen view" (x=10000,y=10000), it still processing them all and give me very low FPS There is any way to process only "inrange" objects to save CPU/GPU usage? It is a Normal Draw (drawCircle) slower or heavier than an Image? Thanks
  14. I'm trying to make game resize appropriately to size of the window/screen. Everything's working out great, except for the tilemap. It seems like the rendering bounds are not updated. (typescript) onResize() { this.game.scale.refresh(); var newWidth = window.innerWidth / 3; var newHeight = window.innerHeight / 3; this.game.scale.setGameSize(newWidth, newHeight); this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; //need to call this to apply new size? this.game.camera.setSize(newWidth, newHeight); for (var i = 0; i < this.tilemap.layer.length; i++) { this.tilemap.layer[i].width = newWidth; this.tilemap.layer[i].resizeFrame(this.tilemap, newWidth, newHeight); this.tilemap.layer[i].crop(new Phaser.Rectangle(0, 0, newWidth, newHeight), false); this.tilemap.layer[i].updateCrop(); } this.game.camera.follow(this.player.sprite, Phaser.Camera.FOLLOW_TOPDOWN, 0.8, 0.8); } As you can see I've tried everything, I would've expected resizeFrame or crop to do something, but unfortunately they don't. Do note that the rest of the game updates the size correctly, as the fish get rendered in the widened area just fine. Any ideas how to update the tilemap to the new size? Thanks!
  15. https://www.babylonjs-playground.com/#4HUQQ#207 Hello again, I'm trying to figure out how to check for collisions using intersectsMesh method. The problem is that when I start my scene, the intersectsMesh callback is called since I believe the meshes start at the origin point of the world on the first render before they are moved. The PG above demonstrates the problem. If you open up the browser's developer console, you would see "SHOULDNT HAPPEN" when the mesh intersections occurred. Any tips on how to prevent this problem? Thank you!
  16. Mezzorio

    Sprite Movement

    Hey Guys, I'm currently moving my camera around a series of sprites but the movement is painful to look at and jerky when moving the sprites and especially with higher speeds, is there anything you can do to fix/help the lag/poor performance as it isn't really usable as a build in this current state. I also as @Wingnut said have the issue that the transparent background is still clickable. Here is my current playground: https://www.babylonjs-playground.com/#41N19L#3 @Deltakosh @Wingnut @JohnK Any incites Guys?
  17. splayna

    babylonjs sever mode

    My earlier question has dissapeared or been deleted. Let me try again. Can I run babylonjs in server mode similar to UE4 server mode where no rendering and other processing required but only the game and actor states.
  18. ixdHenry

    Is this a rendering issue or...

    My issue here is I'm trying to create a countdown timer using fonts and styling of my choice but I don't know how to update the text variable. I want to call the addChild method once and have the value of that string updated in a function. The only way I can see the updated countdown is with the addChild method but at the moment that leaves duplicate copies of the object on the screen. The render does not clear the canvas even though I read in the documentation it's set to do that by default. I tried two methods to get the desired results: var countdown = new PIXI.Text( days+" days "+hours+" hours " +minutes+" minutes "+seconds+" seconds ",timerStyle); countdown.updateText(); timerContainer.addChild(countdown) //tried a second method and that was use to create a sprite from the text textSprite = new PIXI.Sprite(countdown.texture); timerContainer.addChild(textSprite); I did some extensive google searching and I learned that you need to use the function .updateText(); in order for the text variable to actually update. I thought this would work but it does nothing to change the string value on the screen. I have also tried to declare and add the countdown variable to the stage, outside the function but the text does not update. Any suggestions would be greatly appreciated.
  19. I am confused with the two main methods to animate objects in pixi.js. The first one is to build a sprite and put it in a PIXI.Container. I can then add this container as a child of the PIXI stage. Every tick of the animation I just need to update the sprite's position and PIXI will handle the rest for me. I can also build a sprite or a displayObject and create a RenderTexture which is about the same size of what I want to render. Then I use renderer.render(DisplayObject, RenderTexture); to render it on the screen. This works fine too. I still need to update the position on every tick so the displayObject will animate. But what is the difference between using a Container and a RenderTexture? There must be a reason we have two options to render something. What use cases are these two methods best fitted in?
  20. Florian

    Funky Rendered meshes

    Hi guys , I'm fairly new to babylon and this forum. But I already like it a lot. Thanks for the knowledge that is shared over here! I'm trying to build my first little babylon experiment with a friend and we ran into a problem which we don't know how to solve. It's a small scene with a couple of skeletal animations. You can find over here: http://www.somewhere.gl/beta/AnimTest_v06.html When its done it should be looking like this, ...Reference Frame The meshes getting rendered in a funky manner/order We think it has something to do with the alphaIndexes and all our non-opaque meshes. We already searched for it an read this article: about how things are rendered, but we still don't know the best way to fix this: Some advice, best practices would be very welcome. THANKS IN ADVANCE flo PS.: Had some trouble with building a working playground. (It always said that I need to have a camera.) -- A LOT OF CODE WAS POSTED HERE --
  21. Is there a way to call specific function or event when render finishing with rendering specific sprite or event when shader is executed ?
  22. Hi, I know this should not be BabylonJS issue, just intend to aware people that Lenovo Phab 2 Pro may have canvas rendering issue. I am using chome to open the webpage, while firefox and opera had no problem displaying the 3D scene. below are screenshots of webpage with webgl content: The Sponza Demo: www.babylonjs.com/demos/sponza/ The Espilit Demo: https://www.babylonjs.com/demos/espilit/ The Instances Demo: https://www.babylonjs.com/demos/instances/ And all ThreeJS projects I had viewed so far have this issue too: Lasertown: http://oletus.github.io/lasertown/ The Aviator: https://tympanus.net/Tutorials/TheAviator/ It looks like the major area of the canvas is covered, and leaving only a small rectangle area at the left bottom corner to be viewable, I am able to apply user input beyond the viewable rectangle area to navigate the scene(for example the Espilit demo). I had file an bug report to chrome and intend to file another one to lenovo as well.
  23. OakTreePeter

    Tiled map being rendered incorrectly

    Hi everybody, Going straight to the point - I've designed a tiled map using Tiled. When I have my game use it, it is rendered incorrectly, with tiles being placed in places I don't want to. I've tried everything I could, with my limited knowledge (I've started using Phaser about a month ago). Needless to say, I've been failing miserably. Any ideas as to what's making this happen? My many thanks! <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Phaser - Making your first game, part 9</title> <script type="text/javascript" src="js/phaser.min.js"></script> <style type="text/css"> body { margin: 0; } </style> </head> <body> <script type="text/javascript"> var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); // We bring Phaser to life by creating a 'Phaser.Game' object and assigning it to a local variable called 'game'. /* In 'Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update })' ... - The first two parameters, '800' and '600', are the width and the height of our game canvas. - The third parameter, 'Phaser.AUTO', automatically chooses the game's rendering method - either WebGL ('Phaser.WEBGL') or Canvas ('Phaser.CANVAS'). - The fourth parameter, '', is the ID of the DOM element where our game's canvas is to be located. If this parameter is left blank, our game's canvas will be located in our HTML's 'body' element. - The fifth and final parameter, '{ preload: preload, create: create, update: update }', is an object that references some of Phaser's essential functions ... 1) 'preload': Loads all assets used by our game (images, sounds, ...); 2) 'create': Creates our game's world using the assets loaded by 'preload' (background, characters, music, ...); 3) 'update': Handles game logic (player movement, object collision, ...); 4) 'render': Calls post-render effects (blur, color correction, ...). That's it! */ function preload() { // Loads all assets used by our game. // Level game.load.tilemap('level', 'assets/mapa_3.json', null, Phaser.Tilemap.TILED_JSON); // Loads our level's architecture. The first parameter, 'level', is how we'll refer to the 'mapa.json' asset and the second parameter, 'assets/mapa.json', is the location of our asset. game.load.image('tiles', 'assets/tiles - plataformas2.png'); // Loads our level's tileset. The first parameter, 'tiles', is how we'll refer to the 'tiles.png' asset and the second parameter, 'assets/tiles.png', is the location of our asset. // Characters game.load.spritesheet('dude', 'assets/dude.png', 32, 48); // The first parameter, 'dude', is how we'll refer to the 'dude.png' asset and the second parameter, 'assets/dude.png', is the location of our asset. Sprite sheets contain animation frames (more at 'http://phaser.io/tutorials/making-your-first-phaser-game/part4'). game.load.image('enemy', 'assets/baddie.png', 128, 32); // The first parameter, 'enemy', is how we'll refer to the 'baddie.png' asset and the second parameter, 'assets/baddie.png', is the location of our asset. Sprite sheets contain animation frames (more at 'http://phaser.io/tutorials/making-your-first-phaser-game/part4'). // Objects game.load.image('star', 'assets/energy.png'); // The first parameter, 'star', is how we'll refer to the 'star.png' asset and the second parameter, 'assets/star.png', is the location of our asset. // Sound game.load.audio('music', 'assets/music.ogg'); // The first parameter, 'music', is how we'll refer to the 'music.ogg' asset and the second parameter, 'assets/music.ogg', is the location of our asset. } var player; // Declares the global variable 'player' for later use. var enemy; // Declares the global variable 'enemy' for later use. var cursors; // Declares the global variable 'cursors' for later use. var stars; // Declares the global variable 'stars' for later use. var score = 0; // Declares the global variable 'score' for later use. var scoreText; // Declares the global variable 'scoreText' for later use. var music; // Declares the global variable 'music' for later use. var map; // Declares the global variable 'map' for later use. var bg_layer; // Declares the global variable 'bg_layer' for later use. var fg_layer; // Declares the global variable 'fg_layer' for later use. var edges_layer; // Declares the global variable 'edges_layer' for later use. function create() { // Creates our game's world using the assets loaded by 'preload'. // General game.physics.startSystem(Phaser.Physics.ARCADE); // Enables our physics system. map = game.add.tilemap('level'); // Gives shape to our game level. map.addTilesetImage('tiles'); // Fills our level's shape using the tiles in the 'tiles' tileset. bg_layer = map.createLayer('Background'); // Creates a background using the 'Background' layer in 'mapa.json'. fg_layer = map.createLayer('Foreground'); // Creates a foreground using the 'Foreground' layer in 'mapa.json'. edges_layer = map.createLayer('Edges'); // Creates invisible walls around platform edges using the 'Edges' layer in 'mapa.json'. front_layer = map.createLayer('Front'); // Adds some extras to the background using the 'Front' layer in 'mapa.json'. map.setCollisionBetween(1, 10000, true, fg_layer); // Allows our characters to collide with the foreground layer. map.setCollisionBetween(1, 10000, true, edges_layer); // Allows our characters to collide with the invisible walls around platform edges. bg_layer.resizeWorld(); // Matches layer dimensions with game world dimensions ('800' by '600' pixels). // Player player = game.add.sprite(128, 64, 'dude'); // Adds a character to our game. The first two parameters, '128' and '64', are the X and Y coordinates we want to position our asset at and the third parameter, 'dude', is the asset itself. game.physics.arcade.enable(player); // Enables physics for our character. player.body.bounce.y = 0.2; // Gives our character some bounce. player.body.gravity.y = 400; // Applies gravity to our character. player.body.collideWorldBounds = true; // Allows our character to collide with the game world bounds. player.animations.add('left', [0, 1, 2, 3], 10, true); // Gives our character some animation whenever he moves to the left. The first parameter, 'left', is the movement that triggers the frames '[0, 1, 2, 3]' in the second parameter. The third parameter, '10', tells the animation to run at 10 frames per second while 'true', the fourth and final parameter, tells the animation to loop. player.animations.add('right', [5, 6, 7, 8], 10, true); // Gives our character some animation whenever he moves to the right. The first parameter, 'right', is the movement that triggers the frames '[5, 6, 7, 8]' in the second parameter. The third parameter, '10', tells the animation to run at 10 frames per second while 'true', the fourth and final parameter, tells the animation to loop. game.camera.follow(player); // Follows our character around the game world. // Enemy enemy = game.add.sprite(250, 150, 'enemy'); // Adds an enemy to our game. The first two parameters, '32' and 'game.world.height - 150', are the X and Y coordinates we want to position our asset at and the third parameter, 'dude', is the asset itself. game.physics.arcade.enable(enemy); // Enables physics for our character. enemy.body.bounce.setTo(1, 1); // Allows our enemy to bounce off walls (visible or not) and off the ground. enemy.body.gravity.y = 400; // Applies gravity to our enemy. enemy.body.collideWorldBounds = true; // Allows our enemy to collide with the game world bounds. enemy.body.velocity.x = 50; // Allows our enemy to move. // Collectibles stars = game.add.group(); // Creates a 'stars' group that will allow us to manipulate all star collectibles in our game simultaneously. stars.enableBody = true; // Enables physics for any star collectible in the 'stars' group. for (var i = 0; i < 12; i++) // Creates 12 star collectibles, all of them evenly spaced apart. { var star = stars.create(i * 70, 0, 'star'); // Creates a star collectible. The first two parameters, 'i * 70' and '0', are the X and Y coordinates we want to position our asset at and the third parameter, 'star', is the asset itself. star.body.gravity.y = 300; // Applies gravity to our star collectible. star.body.bounce.y = 0.7 + Math.random() * 0.2; // Gives our star collectible some bounce. } // Score scoreText = game.add.text(16, 16, 'score: 0', { fontSize: '32px', fill: '#fff' }); // Creates a score text. The first two parameters, '16' and '16', are the X and Y coordinates we want to position our default text, 'score: 0', at and the fourth and final parameter, '{ fontSize: '32px', fill: '#000' }', is the size and color of the text itself. // Player input cursors = game.input.keyboard.createCursorKeys(); // Enables our game controls. // Sound music = game.add.audio('music'); // Adds a music to our game. music.loop = true; // Loops our game's music. music.play(); // Plays the music. } function update() { // Handles game logic (player movement, object collision, ...). // Collision detection game.physics.arcade.collide(player, fg_layer); // Allows our character to collide with platforms. game.physics.arcade.collide(enemy, fg_layer); // Allows our enemies to collide with platforms. game.physics.arcade.collide(enemy, edges_layer); // Allows our enemies to collide with the invisible walls around platform edges. game.physics.arcade.collide(stars, fg_layer); // Allows our character to collide with star collectibles. // Touch detection game.physics.arcade.overlap(player, stars, collectStar, null, this); // Checks if our character overlaps with any of the star collectibles and, if he does, calls the 'collectStar' function. game.physics.arcade.overlap(player, enemy, gameOver, null, this); // Checks if our character overlaps with any of our enemies and, if he does, calls the 'gameOver' function. // Player movement player.body.velocity.x = 0; // Resets our character's horizontal movement. if (cursors.left.isDown) // If the 'left' key on our keyboard is pressed ... { player.body.velocity.x = -150; // ... we move our character to the left ... player.animations.play('left'); // ... and play the 'left' animation. } else if (cursors.right.isDown) // If the 'right' key on our keyboard is pressed ... { player.body.velocity.x = 150; // ... we move our character to the right ... player.animations.play('right'); // ... and play the 'right' animation. } else // If no key on our keyboard is pressed ... { player.animations.stop(); // ... we play no animation whatsoever ... player.frame = 4; // ... we display our character on its frame 4 position. } if (cursors.up.isDown && (player.body.blocked.down || player.body.touching.down)) // If the 'up' key on our keyboard is pressed and our character is touching a surface ... { player.body.velocity.y = -350; // ... we allow our character to jump. } } function collectStar (player, star) { // This function is called if our character overlaps with any of the star collectibles. star.kill(); // If our character overlaps with any of the star collectibles, that star collectible is removed from the screen ... score += 10; // ... the score is incremented ... scoreText.text = 'Score: ' + score; // ... and the score is updated. } function gameOver (player, enemy) { // This function is called if our character overlaps with any of the enemies. player.kill(); // If our character overlaps with any of the enemies, our player dies. } </script> </body> </html>
  24. WhipJr

    debug doesn't seem to work?

    I've recently been coding an infinite runner game in which the player is allowed to attack freely as they encounter obstacles and enemies. this being said, there is various objects that use collisions and physics bodies for collision detection and i have tried everything i have found to render the debug boxes to no avail. Attack = function() { Phaser.Sprite.call(this, game, player.x + 15, player.y, 'Attack'); game.add.existing(this); game.physics.enable(this, Phaser.Physics.ARCADE); this.animations.add('attack'); this.animations.play('attack', 8, false, true); this.body.setSize(50, 80, 30, 0); this.body.allowGravity = false; this.body.immovable = true; game.time.events.add(Phaser.Timer.SECOND * attackSpeed, setAttack, this); curAtk = this; }; //these set the variable 'Objects' Attack.prototype = Object.create(Phaser.Sprite.prototype); Attack.prototype.constructor = Enemy; //this checks conditions specific for the Attack Object made through the class every update. Attack.prototype.update = function() { this.x = player.x + 15; this.y = player.y; this.game.debug.bodyInfo(this); }; here is specifically the attacking object spawn which spawns the attack object, and on the last line of actual code i try to call the debug information to render. I'm not sure that this is the way to do it, but i have added the "render: render" to my game initialization and tried to call the code in that as well plus using the references within the examples as well and i cannot for the life of me figure out why the body's are not debugging allowing me to fine tune the desired collision areas. Any thoughts or ideas are welcome. if more code is needed of what i have i can upload my JS files. Also a quick note, there are no error messages. and everything runs as expected aside from the debugging aspect and proper hit-box areas.
  25. How to dispose a material on run time and dynamically create again. I want when my sphere material collide with floor material my sphere material should dispose completely and I want to create a new sphere material again. @Deltakosh @Wingnut @Dad72