-
Posts
100 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
Recent Profile Visitors
1,552 profile views
Yora's Achievements
-
Hi, I'm wondering if there is a way for the pointerup callback to be called even if the pointer is released outside of the input area: var slotDragZone = this.scene.add.zone(102, 0, 480, 100).setInteractive(); slotDragZone.on('pointerup', this.slotDragButtonUp); Currently, slotDragButtonUp won't be called unless the pointer is released within the input area, and I have a lot of functions that rely on that occurring (migrated from Phaser 2). I've been digging around the Phaser 3 code to find a way to do it but haven't been able to figure out a viable solution that doesn't involve extensive changes to my code. Currently my thought is when 'pointerdown' is called on a game object to save it, then when the pointer is released, force the callback assigned to the object to occur. This has problems like the callback seems only reachable via an unintended obj._events.pointerup.fn() without setting the callback manually on every object, and when obj._events.pointerup.fn() is called I'd be calling in a different context. If anyone can think of a better way to handle this I would really appreciate it, thanks. ?
-
When it comes to a UI with multiple windows that can be dragged around, each with dynamic amounts of sprites/sub-containers, would something like a Scene for each individual window make any sense? Or would it be better to have the one UI scene and Containers for each window? In v2, I had a windowGroup that contained all the primary windows as Groups, and some of those windows contained dynamic numbers of Groups that were like slots with additional information per existing character. If containers can't contain other containers, I think I can adjust these slots to be v3 Groups, then call Group.each to re-position the entire slot.
-
There it is. Migration has been smooth and easy for me so far, however I feel caught in limbo with how to handle what was once groups, since they no longer have a transform to influence their children (ex. dragging around UIs). I know containers are in the pipeline, but until then I wonder what I should do, maybe hack the Group class in some way temporarily. I already grabbed the getByName function from the List class and put it into Group since I was using that a lot. For the moment for me at least, Groups, Lists and Containers feel a little ambiguous, but I know they are separated for good reasons that I'm sure will become clear. Edit: Actually I'm kinda screwed without proper containers, I'll have to work on something else until they're available.
-
PBMCube reacted to a post in a topic: Is there a Phaser 2 to 3 Migration Guide?
-
Same here. I believe it's still planned however, maybe to be seen in the next newsletter, so personally I'm waiting for it before migrating. I fully respect and understand any delays with it though, the progress on Phaser 3 as a whole has been amazing.
-
It may be an asynchronous action, so maybe something like this will work. //SERVER socket.on("connection",function(socket){ socket.emit("websocket",dateJSON); //dateJSON is a date brought from the datebase, for example the username console.log("The server send a message to client"); }); //CLIENT var UserName; var socket = io.connect("http://localhost:8000"); socket.on("websocket",function(date){ UserName = date[0].username; //Like that because I need the username from the JSON log(); }); function log () { console.log(UserName); };
-
Before calling state.start you may need to do a little manual cleanup first, like removing your event listeners, setting your array lengths to 0 (ex. this.garbage.length = 0, assures the array is cleared out and any objects referenced by it can be cleaned up by the javascript GC (Garbage Collector)), and calling destroy on sprites.
-
Do you see the Game2 state when you call this.state.states? Are you calling remove/destroy on any state objects somewhere? Does calling this.state.checkState("Game2") before starting that state return false? Have you tried loading the game2.js file at the bottom of the HTML file? Kindof obvious questions that will likely be false, but it could also be something obvious being missed that's causing the problem.
-
Awesome stuff! Cut down from 50 something draws to 2, such a massive difference X_X. Though it seems like when bitmapTexts are visible it adds more draw calls even though I have their textures listed in my 'keys' array along with the rest of my textures (13 in total, on a modern PC) and am calling setTexturePriority(keys), but the call is applying for all my other texures as intended. I wanted to give the tilemap system a go since I'm making something that involves a lot of isometric tiles, but as I was spending time trying to manipulate the tilemap classes to work isometrically I decided to wait on trying that since it's quite a process. As it is though, my tiles are working nicely in groups like they were before with far less drawing involved
-
Yora reacted to a post in a topic: Phaser 2.6.0 Released (+ 2.6.1)
-
Scrollable View in Phaser 2.5.0 for Inventory or What?
Yora replied to megabyterain's topic in Phaser 2
You can use masks to not have the inventory area span the whole screen, for example: var subMenu; var mask; subMenu = this.game.make.image(x, y, 'sprites', 'ui/ui_bottom_right_menu_sub_back_3'); subMenu.name = 'subMenu'; subMenu.alpha = 0; mask = this.game.add.graphics(x, y); mask.beginFill(0xffffff); mask.drawRect(0, 0, 200, -300); subMenu.mask = mask; As for the rest with scroll bars and etc, I think it's too specific to be something included in this framework by default, but all the tools to make it are there. There's some math involved depending on the height of the scrolling container versus the height of the scrolling bar.- 2 replies
-
- scroll
- scrollable
- (and 5 more)
-
Yora reacted to a post in a topic: Phaser 2.5.0 Released
-
Yora reacted to a post in a topic: Phaser 2.4.9 RC4 is out - with loads of new things!
-
Yora reacted to a post in a topic: Phaser 2.4.8 is released
-
Awesome, and glad to hear you're taking the chance with pixi v4. I'll keep my fingers crossed for you too
-
I support the idea of switching to pixi v4, and the main loop improvement. Performance is crucial, and if pixi v4 is a good improvement it will benefit many people, albeit a heavy decision to make.
-
No issues here, and the performance is greater than ever. Awesome work!
-
hoskope reacted to a post in a topic: problem with sprite animation
-
totallybueno reacted to a post in a topic: Common Phaser + CocoonJS issues
-
Aaah I'm not sure how I missed how this was the change, but the fix to my original resolution problem was actually in the cocoonjs launcher settings where I had to disable the "WebGL screencanvas" option, then my game filled the screen again. I'm not sure what this option is for, though. Using generateTexture on any display object and then using that texture on a sprite/image is still giving me the same problem though. It seems to work okay the first time I do it (although instead of transparency in the background of the texture it's solid black), then any subsequent textures formed by generateTexture seem to result in a deformed texture when it's used on a sprite. This is only happening in WebGL and Canvas+. WebGL and WebView+ is fine.
-
Yes, there is no problem having it work in Phaser.Canvas mode, it was only occuring in WebGL on Canvas+. However when I accidentally uploaded an older version of my game code, suddenly the scaling problem was gone and the entire screen is filled again, and I haven't even been able to replicate the problem after I replaced my current main.js with the old one, so I'm not sure what fixed it to share the information. The bitmap text used as a texture as shown below is still creating the distorted image as before, only with WebGL on Canvas+. I'll keep trying to fix. var _time = _game.make.bitmapText(-85 + (i * 90), 122, 'Agency_35', timeString, 25);time = _game.make.image(-85 + (i * 90), 122, _time.generateTexture());
-
I've been having an issue with scaling after upgrading to Phaser 2.4.4 while using WebGL in Canvas+ (WebGL works fine in webview and webview+, Canvas works fine in Canvas+). window.onload = function () { var width = window.innerWidth * window.devicePixelRatio; var height = window.innerHeight * window.devicePixelRatio; var game = new Phaser.Game(width / (window.devicePixelRatio - 1), height / (window.devicePixelRatio - 1), Phaser.WEB_GL, ''); game.state.add('Boot', require('./states/Boot')); game.state.add('Preloader', require('./states/Preloader')); game.state.add('MainMenu', require('./states/MainMenu')); game.state.add('Main', require('./states/Main')); game.state.start('Boot');};Trying different scale modes in 'Boot': //this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;//this.game.scale.scaleMode = Phaser.ScaleManager.RESIZE;this.game.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT;All scaling via the cocoonjs app is disabled so it would be handled by Phaser (have tried cocoonjs options on their own). However after updating Phaser 2.4.4, I can't get the game to re-scale after creation, in which I want it to stretch and fill the whole screen via the Phaser scale manager. Instead it's been doing this: All inputs are handled as if the entire screen were filled, ex. the scroll bar moves around when touching the right end of the screen. Also the bitmap texts that I'm converting to images are appearing funky, only in this setting; it works otherwise. var _time = _game.make.bitmapText(-85 + (i * 90), 122, 'Agency_35', timeString, 25);time = _game.make.image(-85 + (i * 90), 122, _time.generateTexture());^ gives the text that jarbled up appearance (only in WebGL Canvas+). I've been fiddling and poking around but am not quite sure what exactly changed in the newest update that started causing this; with Phaser 2.4.3, the same code gives the desired result filling the screen. I'd appreciate any help, since it could be something very obvious that's eating my time. Thanks!