-
Content Count
5 -
Joined
-
Last visited
About localtoast_zader
-
Rank
Newbie
Contact Methods
-
Website URL
localtoast.io
-
Twitter
@zackderose
Profile Information
-
Gender
Male
-
Location
South Carolina - USA
-
Interests
Angular, RPGs, Ambition
-
glebk reacted to a post in a topic: Phaser + DOM
-
Draw Line from one sprite to another
localtoast_zader replied to localtoast_zader's topic in Phaser 3
Much appreciated! I'll look to mess around with setOrigin - still very new to phaser so discovering alot as I go. -
localtoast_zader reacted to a post in a topic: Draw Line from one sprite to another
-
localtoast_zader reacted to a post in a topic: How to align game in webpage
-
localtoast_zader changed their profile photo
-
I think I see the issue. Counter-intuitively, putting the `script` tag inside your `canvas` tag doesn't attach your Phaser game to the canvas, this is just a html5 thing. You can have your `script` tag that references your game anywhere (probably best to keep it in your `head` tag with the other scripts. Inside the config object for your game though you have to link to the html canvas element like so: var game = new Phaser.Game({ type: Phaser.AUTO, width: 1000, height: 1000, physics: { default: 'arcade', arcade: {gravity: {y: 500}} }, scene: [ scene ], canva
-
localtoast_zader reacted to a post in a topic: Chaining multiple animations together
-
localtoast_zader reacted to a post in a topic: Chaining multiple animations together
-
Draw Line from one sprite to another
localtoast_zader replied to localtoast_zader's topic in Phaser 3
I was able to mostly solve my issue by using the `Phaser.Geom.Line` as opposed to the `Phaser.GameObjects.Line`: // creating my line const line = new Phaser.Geom.Line( sprite1.x, sprite1.y, sprite2.x, sprite2.y ); // in Scene.update() this.graphics.strokeLineShape(line) I'd still like to be able to do some "GameObject-y" things with these lines though, so if someone can help with the original question that'd be much appreciated!! -
localtoast_zader reacted to a post in a topic: Phaser 3 on server side to validate client actions
-
I'm primarily an Angular developer, started messing around with phaser just recently and have been really enjoying the way the frameworks complement each other. 1. When extending a Phaser object to create your own object, you can add an Angular EventEmitter (or emitters) as a way to communicate between the frameworks. Phaser objects in turn can be passed in as inputs to an Angular component - or you can create an Angular Service for your Phaser.Game object and inject that service into components that need it. I'm not quite sure of the best method yet, but the patterns I've been experiment
-
localtoast_zader reacted to a post in a topic: How to set sprite height/width
-
Assuming 2 sprites in a scene, how does one draw a line from one to the other? Here's my attempt, starting from one of the examples in the sandbox: function create (data) { const sprite1 = this.add.sprite(100, 100, 'mech'); const sprite2 = this.add.sprite(400, 400, 'mech'); sprite1.setInteractive(); sprite1.on( 'pointerdown', () => this.add.line( 0, 0, sprite1.x, sprite1.y, sprite2.x, sprite2.y, 0xff0000 ) ); } result after clicking: